-
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
Environment not activated on powershell even though the pop up says it does (shell integration fails) #22888
Comments
@Scarfmonster Could you provide a screenshot on how are you checking whether the environment has activated in terminal? Please provide the debug logs which can help diagnose the issue:
Output for
|
The Python output:
Running |
Can you print these in powershell which is expected to be activated?
|
$env:PATH # Terminal Environment Changes
## Extension: vscode.git
Enables the following features: git auth provider
- `GIT_ASKPASS=d:\Programming\VSCode\resources\app\extensions\git\dist\askpass.sh`
- `VSCODE_GIT_ASKPASS_NODE=D:\Programming\VSCode\Code.exe`
- `VSCODE_GIT_ASKPASS_EXTRA_ARGS=`
- `VSCODE_GIT_ASKPASS_MAIN=d:\Programming\VSCode\resources\app\extensions\git\dist\askpass-main.js`
- `VSCODE_GIT_IPC_HANDLE=\\.\pipe\vscode-git-3c79dd7708-sock`
## Extension: ms-python.python
Activated environment for `.\.venv\Scripts\python.exe`
- `PATH=d:\Programming\VSCode\data\extensions\ms-python.python-2024.0.1\pythonFiles\deactivate\powershell;D:\test\.venv/Scripts;${env:PATH}`
- `VIRTUAL_ENV=D:\test\.venv` |
Thanks for the info @Scarfmonster. Your screenshot says "Shell integration failed to activate", which is the cause. Right now due to a limitation on VS Code's end, we've to assume shell integration always work with Powershell: microsoft/vscode#204616. I'm wondering if you might have script execution disabled on powershell due to which it's failing for you, try running the following after opening Powershell as admin:
If that still doesn't fix the issue, we can open up an issue for you on VS Code so they can investigate why shell integration fails in your case. |
Can you open a new powershell terminal and then check? |
Opening a new terminal after starting VSCode has the same "Shell integration failed to activate". Leaving the terminal open and then repeatedly closing and opening VSCode several times causes the result from last screenshot again. This doesn't happen if I close and open terminals without closing VSCode. |
Got it thanks. @Scarfmonster Can you open an issue on VS Code https://github.com/Microsoft/vscode so we can get an answer on why shell integration fails to activate in your case? Let me know if you need any help in that regard, I'll be sure to monitor whatever you open, but it's better if you're one to initiate it. |
FWIW I also expect your issue to be fixed once microsoft/vscode#204616 is taken care of. |
I had the same issue, but setting So this definitely has something to do with the environment variable based activation. It's not doing that properly? |
Im running in to this issue as well, using zsh with powerlevel10k prompt. When I switch to a different prompt like omz Disabling |
Hey @anthonykim1, this issue might need further attention. @karrtikr, you can help us out by closing this issue if the problem no longer exists, or adding more information. |
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off. Happy Coding! |
A very similar thing started happening to me on Windows. I got a pop-up pointing me to this page: https://github.com/microsoft/vscode-python/wiki/Activate-Environments-in-Terminal-Using-Environment-Variables
And in the terminal tab info it does say
Python: Activated environment for .\.venv\Scripts\python.exe
But the environment is not active.
Originally posted by @Scarfmonster in #22881 (comment)
The text was updated successfully, but these errors were encountered: