-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
A followup to #171066 fixing zsh and fish shells implementations #223421
A followup to #171066 fixing zsh and fish shells implementations #223421
Conversation
…ions microsoft#171066 introduced a fix for applying PATH prefix on macOS login shells that resolved microsoft#99878. However it had little issues for each shell implementation. This PR contains the following fixes: `bash` fix: - Add missing `:` separator in the path setter to avoid path corruption - Add missing quotes to avoid path interpretation `zsh` fix: - Add missing `:` separator in the path setter to avoid path corruption - Add missing quotes to avoid path interpretation - Move patching outside of `.zprofile` check as clean macOS install doesn't include this file, nevertheless PATH patching should still happen `fish` fix: - use `set -gx PATH` instead of `fish_add_path` as the latter has no effect on updating the path if entries already exist in it. Which is the case for some extensions, like [`vscode-micromamba`](https://github.com/mamba-org/vscode-micromamba) which modify process environment and after login shell rc processing path entries end up in the end.
I just found that there a second implementation of variables application #179476 that uses Considering that #179476 provides a complete implementation that works for all mutation types and for all shells, including login shell on mac. Shall the workaround for PATH (via VSCODE_PATH_PREFIX) be removed? -- |
as generic env append/prepend can't handle path separators, neither should it be handled here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix and investigation! Looks reasonable and fairly safe to me.
Also yes for #223450 the path separator must be provided by the extension
FYI @meganrogge in case you notice anything going wrong with zsh which has the biggest change. |
#171066 introduced a fix for applying PATH prefix on macOS login shells that resolved #99878. However it had little issues for each shell implementation.
This PR contains the following fixes:
bash
fix:zsh
fix:.zprofile
check as clean macOS install doesn't include this file, nevertheless PATH patching should still happenfish
fix:set -gx PATH
instead offish_add_path
as the latter has no effect on updating the path if entries already exist in it. Which is the case for some extensions, likevscode-micromamba
which modify process environment and after login shell rc processing path entries end up in the end.