-
Notifications
You must be signed in to change notification settings - Fork 36
Closed as not planned
Closed as not planned
Copy link
Labels
info-neededIssue requires more information from posterIssue requires more information from postertriage-needed
Description
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_ENVshould outputnode-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_ENVoutputsbase(or empty)- The base conda environment is activated instead of the configured one
- Manual
conda activate node-devworks correctly
Additional Information:
Environment Details:
- Shell: zsh (default on macOS)
- Conda properly initialized in
.zshrc which condareturns 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.osxconfigurations - ✅ 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.
Metadata
Metadata
Assignees
Labels
info-neededIssue requires more information from posterIssue requires more information from postertriage-needed