Open winstontsai opened 4 months ago
Ok I figured out it's related to some PATH manipulation.
Basically, at the end of my .bashrc
I have some code to deduplicate my PATH. Before that, I also have Homebrew activation, and it turns out that Homebrew activation prepends some entries into PATH that results in a duplicate. Between my Homebrew activation and the PATH deduplication, I have mise
activation. So __MISE_ORIG_PATH
still has the duplicate entry, e.g. /usr/local/bin:/usr/local/sbin:/usr/local/bin:...
but after .bashrc
is complete the second duplicate /usr/local/bin
has been removed.
If I comment out the PATH deduplication in my .bashrc
I can no longer reproduce the issue. However, I'm not sure of the exact mechanics around __MISE_ORIG_PATH
which could cause opening a new integrated terminal to affect the original integrated terminal.
If anyone has an explanation for this that would be great.
I'm thinking once the terminal is initialized, the __MISE_ORIG_PATH
is not a substring of the PATH variable because of the deduplication. This effectively means mise always uses the aggressive PATH update and puts its stuff at the front.
Still need to figure out why opening a new integrated terminal in VS Code triggers mise to recalculate PATH in the original integrated terminal.
Unrelated to VS Code. I believe opening any new terminal triggers mise hook-env in other terminals. Don't know why though.
I faced the same problem on linux. Also I am using an option in vs code to activate venv automatically when terminal opens. It doesn't work predictably anymore. In sense that it shows virtual environment being activated while in fact, it uses mise python and pip. The interpreter which is responsible for intellisense type hinting seem to be affected as well, it's unbearable.
Describe the bug I have an open terminal window with a Python virtual environment active. Opening a second terminal window causes mise to "reset" in the original terminal, putting the mise paths in front of the venv paths.
To Reproduce
I'm using bash on macOS.
type python
a few times to verify the Python venv is activated.type python
once. It still shows the venv is activated. But runtype python
again, and it shows mise python. Checking $PATH reveals that mise paths are in front again.Expected behavior Opening a second terminal should not affect the environment of the first terminal.
mise doctor
output