Does this issue occur when all extensions are disabled?: No (This appears to be related to Python extension functionality)
- VS Code Version: 1.104.0
- Node.js: 22.18.0
- OS Version: Darwin x64 23.6.0, Sonoma 14.6.1 (23G93)
Issue Description
VS Code fails to automatically activate the correct conda environment in integrated terminal despite python.terminal.activateEnvironment: true setting and correct Python interpreter configuration.
Steps to Reproduce:
- Install conda/miniconda and create a conda environment (e.g.,
conda create -n node-dev python=3.x)
- Open VS Code and create a new workspace/project
- Configure workspace settings:
{
"python.defaultInterpreterPath": "/Users/[username]/miniconda3/envs/node-dev/bin/python",
"python.condaPath": "/Users/[username]/miniconda3/bin/conda",
"python.terminal.activateEnvironment": true,
"terminal.integrated.inheritEnv": false
}
- Verify the correct Python interpreter is selected (should show in status bar)
- Open a new integrated terminal (`Cmd+``)
- Observe the terminal prompt and run
echo $CONDA_DEFAULT_ENV
Expected Result:
- Terminal should show
(node-dev) in prompt
echo $CONDA_DEFAULT_ENV should output node-dev
- VS Code should automatically activate the conda environment specified by the Python interpreter
Actual Result:
- Terminal shows
(base) in prompt (or no environment activated)
echo $CONDA_DEFAULT_ENV outputs base (or empty)
- The base conda environment is activated instead of the configured one
- Manual
conda activate node-dev works correctly
Additional Information:
Environment Details:
- Shell: zsh (default on macOS)
- Conda properly initialized in
.zshrc
which conda returns a shell function (normal conda setup)
- Python extension correctly identifies the interpreter (visible in status bar)
Configuration Files:
// Workspace settings
{
"python.defaultInterpreterPath": "/Users/tony/miniconda3/envs/node-dev/bin/python",
"python.condaPath": "/Users/tony/miniconda3/bin/conda",
"python.terminal.activateEnvironment": true,
"terminal.integrated.inheritEnv": false
}
Workaround that works:
Creating a custom terminal profile manually activates the correct environment:
{
"terminal.integrated.defaultProfile.osx": "conda-env",
"terminal.integrated.profiles.osx": {
"conda-env": {
"path": "/bin/zsh",
"args": ["-l", "-c", "conda activate node-dev; exec zsh"]
}
}
}
However, this shouldn't be necessary when python.terminal.activateEnvironment: true is configured.
Tested scenarios:
- ✅ Custom terminal profile with manual conda activate
- ❌
python.terminal.activateEnvironment: true (should work but doesn't)
- ❌ Various
terminal.integrated.env.osx configurations
- ✅ Manual activation after terminal opens
This issue affects productivity as developers need to manually activate the correct environment every time they open a new terminal, despite having the correct configuration.
Does this issue occur when all extensions are disabled?: No (This appears to be related to Python extension functionality)
Issue Description
VS Code fails to automatically activate the correct conda environment in integrated terminal despite
python.terminal.activateEnvironment: truesetting and correct Python interpreter configuration.Steps to Reproduce:
conda create -n node-dev python=3.x){ "python.defaultInterpreterPath": "/Users/[username]/miniconda3/envs/node-dev/bin/python", "python.condaPath": "/Users/[username]/miniconda3/bin/conda", "python.terminal.activateEnvironment": true, "terminal.integrated.inheritEnv": false }echo $CONDA_DEFAULT_ENVExpected Result:
(node-dev)in promptecho $CONDA_DEFAULT_ENVshould outputnode-devActual Result:
(base)in prompt (or no environment activated)echo $CONDA_DEFAULT_ENVoutputsbase(or empty)conda activate node-devworks correctlyAdditional Information:
Environment Details:
.zshrcwhich condareturns a shell function (normal conda setup)Configuration Files:
Workaround that works:
Creating a custom terminal profile manually activates the correct environment:
{ "terminal.integrated.defaultProfile.osx": "conda-env", "terminal.integrated.profiles.osx": { "conda-env": { "path": "/bin/zsh", "args": ["-l", "-c", "conda activate node-dev; exec zsh"] } } }However, this shouldn't be necessary when
python.terminal.activateEnvironment: trueis configured.Tested scenarios:
python.terminal.activateEnvironment: true(should work but doesn't)terminal.integrated.env.osxconfigurationsThis issue affects productivity as developers need to manually activate the correct environment every time they open a new terminal, despite having the correct configuration.