-
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
Use shell integration to get environment variables #23159
Comments
@anthonykim1 Any idea when this will be resolved? |
@AtharvaShekatkar I can't provide a specific date but the team is definitely aware of this. |
@anthonykim1 No complaints. I am a starship user facing the double (.venv) issue and just wanted to know when it'll be solved. |
@AtharvaShekatkar I see, did any of the suggestion #23137 work out? Can you also opt out of shell integration in your settings and see if you still see the duplicate (venv)? Please also check if virtual environment is still correctly activated in this case. This is all in the assumption with you are opt-in for Terminal env var activation experiment. This is late (I think it might've got looked over with issue being tracked here) but to answer #23304 (comment), not too sure why it is only happening to mac in your scenario. I'm guessing one of the possibility might be from currently how we are trying to predict user's PS1 and see if there is (venv) in it. |
@anthonykim1 I'd checked the #23137 thread and tried the solutions listed there, but none worked for me. I also tried opting out of shell integration. That did get rid of the double (venv), but it didn't activate the environment. I haven't opted in for the experiment, and I'm not sure I can given that this is a work laptop. Also, I'm not sure if this only happens on Mac, since I've only used conda with Windows. I'll try using venv and update the thread. |
@anthonykim1 The issue is fixed now. I didn't do anything, so I don't know what fixed it. Letting you know so you can stop tracking it here. |
Great, thank you for letting me know! @AtharvaShekatkar Will still keep this open so we can better handle other's scenario too. Please feel free to open another issue or let me know if it comes back up again. |
Closing this against: microsoft/vscode#227467 |
Use shell integration to get environment variables and activate environment, instead of NodeJS process environment variables.
Python extension should be able to leverage: https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts and microsoft/vscode#207504 to get a full context of user's environment variables, especially those stored, modified in shell specific initialization scripts such as .zshrc, .bashrc.
Using hidden terminal which would have context of these initialization scripts, we can activate terminal environment with better context compared to the currently used process approach by enhancing shell integration hidden terminal approach.
This will resolve lot of issues where users are missing environment variables that are set inside their shell specific initialization script modified such as by
conda activate
if we know they have shell integration working/enabled for their terminal.There will be additional issue/PR to resolve PS1 so users do not see unwanted PS1 if they are using specific prompt such from starship.
There will be additional PR to use replacing option for environment variable instead of prepending option(this is known to shadow some of the important parts such as for PATH variable).
The text was updated successfully, but these errors were encountered: