Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conda environment not showing in terminal prompt after activation on macOS (zsh) #24704

Open
eleliauk opened this issue Jan 8, 2025 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team

Comments

@eleliauk
Copy link

eleliauk commented Jan 8, 2025

Does this issue occur when all extensions are disabled?: Yes/No

Description:
After activating the Conda base environment in VS Code’s terminal (using zsh), the environment name does not appear in the terminal prompt. Running conda env list shows the environment is active, but the terminal prompt does not reflect it.

Steps to Reproduce:
1. Open VS Code and launch the integrated terminal (zsh).
2. Activate the Conda base environment with conda activate base.
3. Observe that the terminal prompt does not show (base) even though conda env list indicates the environment is active.

Expected Behavior:
The terminal prompt should show the activated Conda environment (e.g., (base)) after running conda activate base.

Actual Behavior:
The terminal prompt does not reflect the active Conda environment.

Workaround Attempts:
• Verified auto_activate_base: true with conda config --show auto_activate_base.
• Re-ran source ~/.zshrc.
• Restarted VS Code and terminal.
• The issue persists.

VS Code Version:
1.96.2

OS Version:
macOS 15.1

Does this issue occur when all extensions are disabled?
Yes

~ conda activate base
➜  ~ conda env list     

# conda environments:
#
base                 * /Users/shanyujia/miniconda3
2024-hackthon-RockCat   /Users/shanyujia/miniconda3/envs/2024-hackthon-RockCat
comparedoxome          /Users/shanyujia/miniconda3/envs/comparedoxome
emollm                 /Users/shanyujia/miniconda3/envs/emollm
inula                  /Users/shanyujia/miniconda3/envs/inula
latex                  /Users/shanyujia/miniconda3/envs/latex
rockcat                /Users/shanyujia/miniconda3/envs/rockcat

➜  ~ 
@meganrogge meganrogge assigned karthiknadig and unassigned meganrogge Jan 8, 2025
@karthiknadig karthiknadig transferred this issue from microsoft/vscode Jan 8, 2025
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Jan 8, 2025
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 8, 2025
@karthiknadig
Copy link
Member

Add the following to your User settings.json, and Reload VS Code:

    "python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"]

Then open a new terminal, that should get it to activate correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

3 participants