-
Notifications
You must be signed in to change notification settings - Fork 28.9k
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 always uses getUnixShellEnvironment if the first launch is from the GUI #55144
Comments
(Experimental duplicate detection) |
/duplicate #15452 |
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines. Happy Coding! |
`VSCODE_CLI` was checked from the main process, which had it set depending on if the *first* launch of VS Code was launched from cli or not, instead of whether the *current* launch has it set. So I changed the check to checking the userEnv passed to the new browser window. Note that the assignment of `lazyEnv` and `userEnv` into `process.env` was racing before! Which is a bug in and of itself. After this fix, the `shellEnv`/`lazyEnv` overrides the passed in `userEnv`, but that can be changed later if needed. We are also always launching the shell now since `configuration.userEnv` is not available yet when `lazyEnv` is initialized. It will require a hack or some refactoring to fix, so I left that like this for now. Might want to open an issue for future reference. Fixes microsoft#55144
This should be fixed now based on #108804 (comment) |
\closedWith 6f3fcd2 |
Steps to Reproduce:
VSCODE_CLI
will be unset)PATH
, for example: Enter avirtualenv
.code .
.process.env
. YourPATH
will be reset to your shell's default.The cause is that this code: https://github.com/Microsoft/vscode/blob/d983257e6f8db693962d0dba9a025678f50778fe/src/vs/code/node/shellEnv.ts#L83-L92
Is executed in the VS Code main process that gets it's environment variables from the first launch of VS Code instead of checking if the new environment that was received for this launch request is from the GUI or CLI.
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: