-
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
VS Code auto-activating python virtual environment, but not auto-updating PowerShell prompt correctly with (.venv) prefix as expected #22723
Comments
Please read this. But be careful as this feature seems to have glitches at moment, so you may end up with a non-activated environment, even with alerts and documentation saying otherwise. I'm about to open a new issue about that. Anyway, your issue should still be considered, as having a |
What was wrong with the old way? This new change feels like a regression. It hurts the majority of users for a feature(s) only a small minority will use. When i open a terminal i expect it to activate the venv and show the venv prefix. |
@JustinOstrowsky take a look at #11039. I don't know the details of this new implementation, but the old way was a bit hacky to my taste. You could see the commands being typed on the terminal, and sometimes the activation command would scramble over other commands. |
Thanks for the link to the prior discussions as they didn't readily show up after much searching. Didn't know about mousing over the terminal tab to see details on virtual environment which is nice. Would still like to see the prompt get updated w/venv at some point... to quote Tim Peters, 'Explicit is better than implicit.' |
Use |
same situation on unbuntu22 with zsh. The last version of this extension is working fine. I don't want to set auto_activate_base to false. I need it when I use terminal independently. |
Thanks all for reporting and providing the pointers, as you suspect this is a known behavior, but we're restricted by a technical limitation which prevents us from showing
@ubalklen I'm interested in this, I noticed you haven't gotten the chance to open an issue yet. We would be happy to take a look. @EeyoreLee We're working on a fix here which avoids the issue for zsh, given shell integration is enabled: #22850. You can subscribe to #22774 for further updates but we hope to make a pre-release in a day or two. |
As for the main issue in hand, check out #22289, where we're considering providing an opt out for virtual environments. |
Steps to Reproduce:
pip -V
orGet-Command python
which shows it's pointing to the correct .venv path.\.venv\Scripts\Activate.ps1
is get the correct prompt prefix(.venv) PS C:\dev\arm_sandbox>
Unrestricted
... any ideas on what might be the issue? If I switch to running VS Code in an Ubuntu/WSL session it works as expected.
red underlines added for emphasis
The text was updated successfully, but these errors were encountered: