-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
venv not activated for cmd on Windows #22309
Comments
You might need to wait a bit for Python extension to finish "Reactivating terminals..." before cmd gets activated. If that's not the case, I would really appreciate the debug logs:
Output for
|
I assume:
|
I never see a "reactivating terminals" progress notification anywhere. Yes Python was activated, .venv was selected, there weren't signs about relaunching the terminal for the cmd prompt. This repros no matter how many times I create a cmd terminal, and when I hover them they all say the venv env var was successfully added Debug logs from Python extension when launching a cmd terminal:
|
After clicking that I get
|
Output for
|
It seems like the default shell is still powershell based on the logs:
Per TPI, try changing the default shell to cmd, waiting to reactivate, then open a new terminal. |
Closing as it's expected if cmd is not chosen as default. Let me know if it's still an issue after cmd is chosen as default and we can have a further look. |
@karrtikr why does this only apply to default terminals? I repro this by creating a cmd terminal from the + dropdown, and I would expect activating virtual environments to work for that as well. |
@joyceerhl Technical limitation by VS Code, currently same environment collection is applied to all shells. So we just apply the env collection for the default shell. We have plans to add a "shell" scope based on user feedback if need be: https://code.visualstudio.com/api/references/vscode-api#EnvironmentVariableScope, after which it should be possible to activate each shell differently. |
Testing #22288
python -c"import sys;print(sys.executable)"
The text was updated successfully, but these errors were encountered: