You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: some of the packages are not changing accordingly #337
Describe the bug
Won't change version, always fallback to machine's env like java to usr/bin/java and nodejs to usr/local/bin/node.
Is there anything wrong with my setup? since I just brew update && brew upgrade everything yesterday? (might be an issue with some packages that always falling back to default version?)
I have the same issue...
But only in my VS Code Terminal .. I use Warp for my main standalone Terminal, and everything works fine there.. any solution to this? @padulkemid maybe you solved it?
I have the same issue... But only in my VS Code Terminal .. I use Warp for my main standalone Terminal, and everything works fine there.. any solution to this? @padulkemid maybe you solved it?
i think its about the pathing source and stuff (it might be, from the PATH commit earlier) I haven't take a look at it, since it causes my workflow to be broken,so I moved into mise now @kuddl
I "kind of fixed it", but do not know why it worked:
Even though the VSCode terminal said: echo $SHELL -> /bin/zsh
vfox was not poperly activated ...
I added the bash activate (!) command to my .zshrc, and then it work as expected.
by taking a look at the code, there are subtle differences between activating the shell in zsh and bash, 2 of this has the same commands but there are some quirks that made the same commands achieve different result, might something to do
This still happens in 1.0.13 (main is still the v1.0.13 commit, b67f56e). When a login shell starts with vfox directories already in PATH, macOS path_helper moves them behind /usr/local/bin, /usr/bin and the other system directories, and vfox activate does not move them back to the front. That is the situation in a tmux pane or a zsh -l typed in a vfox shell. It is also the terminal in VS Code: a login shell on top of the environment VS Code resolved from a login shell at startup, or inherited from the shell that ran code (VS Code's terminal profiles FAQ describes the reordering). The $PATH in the reporter's second comment has the same shape.
I checked on a GitHub-hosted macOS runner (macOS 26.6.2, arm64, zsh 5.9, the real /usr/libexec/path_helper) with the release binaries of 0.5.4, 1.0.8, 1.0.10 and 1.0.13: https://github.com/linghengqian/vfox/actions/runs/39403641018. That is my fork's e2e job with scripts/e2e-test.sh replaced by this script. Everything starts from env -i and an interactive login zsh, with eval "$(vfox activate zsh)" in ~/.zshrc and global versions set beforehand for demo nodejs and java SDKs (stub scripts in the install directories). /usr/bin/java is the real one. The runner's node is Homebrew's, so I put a stand-in at /usr/local/bin/node. A third demo SDK with no system counterpart resolved to vfox in every case, like kotlin and golang in the report.
What node and java resolve to (vfox: both from vfox's directories, system: /usr/local/bin/node and /usr/bin/java):
login shell started from
0.5.4
1.0.8
1.0.10
1.0.13
a clean environment (new tab)
vfox
vfox
vfox
vfox
a shell where vfox is active
system
system
system
system
a tmux pane in that shell
system
system
system
system
the environment VS Code resolved at startup
system
system
system
system
a non-login zsh in that shell
vfox
vfox
vfox
vfox
The VS Code row replays what VS Code does: at startup it runs zsh -i -l -c with VSCODE_RESOLVING_ENVIRONMENT=1 and keeps that shell's environment, then the terminal is a login zsh on top of it. I did not run VS Code itself.
The report's steps in the nested shell on 1.0.13, and its PATH:
In 0.5.4 and 1.0.8 the zsh hook skips everything in a shell that inherited its variables (0.5.4, 1.0.8), so the new shell gets neither a PATH export nor the precmd hook. c1ac36b (1.0.10, closes #637 and #655) compares the PID instead, and the hook is registered now. The order is still wrong, because activate (L158) and env (L305) keep whatever sits before the first vfox directory ahead of vfox's own (SplitSystemPaths, added in 717c219 for #622). After path_helper that is the whole system PATH.
With eval "$(brew shellenv)" in ~/.zprofile, the nested shell and the VS Code case resolve node to Homebrew's /opt/homebrew/bin/node on all four versions.
Until this is fixed, dropping the inherited vfox directories before activating works around it:
On 1.0.10 and 1.0.13 it fixed the nested shell, the tmux pane and the VS Code case. It also fixed the nested shell and the VS Code case with brew shellenv in ~/.zprofile. With no vfox directory left in PATH, SplitSystemPaths has no prefix, so activate puts the vfox directories first.
My guess is that the directories path_helper adds (/etc/paths and /etc/paths.d) should not count as user-injected, so a virtualenv that really sits in front keeps its place. I have not tried it.
#736 (merged, not released yet) adds a fix for this, but it has to be switched on:
$ vfox config path.mode baseline
With baseline, vfox activate records the PATH it found, without vfox's own directories, and the entries in front of vfox's that were already in that PATH are moved behind vfox's. That is the case described in the comment above: path_helper puts /usr/local/bin, /usr/bin and the other system directories in front of the vfox directories that a nested shell, a tmux pane or the VS Code terminal inherited.
Checked with builds of v1.0.13 and main, with a PATH shaped like the one path_helper leaves behind (system directories first, vfox's after them). Which command runs after vfox activate:
v1.0.13
main, default
main, path.mode baseline
system
system
vfox
The default stays legacy (the behavior of 1.0.x), so nothing changes until the setting is switched on; whether and when the default changes is tracked in #737. In the default mode vfox use and vfox doctor now say which directory comes first and why, for example `node` runs /usr/local/bin/node instead of [email protected]: its directory comes before vfox in PATH.
baseline leaves one thing alone on purpose: a directory that was added to PATH after vfox activate ran, for example eval "$(brew shellenv)" placed below the vfox line in ~/.zshrc, stays in front. vfox doctor reports it as added after activation and suggests activating vfox after that line, or path.mode aggressive.
A setting change applies at the next prompt, but baseline needs the PATH that was recorded when the shell started, so open a new terminal after upgrading. See PATH Order Settings. This stays open until a release contains path.mode.
Closed by v1.1.0: baseline is now the default path.mode (#738, released 2026-11-07).
What this fixes here: when a login shell starts with vfox directories already in PATH, macOS path_helper moves them behind /usr/local/bin, /usr/bin and the other system directories (nested shell, zsh -l in a vfox shell, tmux pane, VS Code terminal). With baseline, vfox activate records the PATH it found (minus vfox's own directories) in __VFOX_ORIG_PATH and moves entries that were already there behind vfox's directories. Verified before the release with a PATH shaped the way path_helper leaves it: v1.0.13 resolves node/java to the system copy, main with path.mode baseline resolves them to vfox's copy.
After upgrading, open a new terminal: a shell started before the upgrade has no recorded baseline and keeps behaving like legacy until it is restarted. If only a few directories must stay in front, list them in path.preserve instead of switching back to legacy.
If this still reproduces on v1.1.0+ in a fresh terminal, please reopen with vfox --version, vfox config path.mode, vfox doctor, echo $PATH, and which command resolves to the wrong binary.
Activity
padulkemid commentedon Aug 7, 2024
confirmed: work with
kotlinandgolang, justjavaandnodejspadulkemid commentedon Aug 7, 2024
it appears
vfox's dir in$PATHare added in below from the bin, should we move it to the topmost path?padulkemid commentedon Aug 7, 2024
I think this commit is from months ago and the version before works fine, is this
PATHchanging state are handled in here?kuddl commentedon Oct 29, 2024
I have the same issue...
But only in my VS Code Terminal .. I use Warp for my main standalone Terminal, and everything works fine there.. any solution to this? @padulkemid maybe you solved it?
padulkemid commentedon Oct 29, 2024
i think its about the pathing source and stuff (it might be, from the
PATHcommit earlier) I haven't take a look at it, since it causes my workflow to be broken,so I moved intomisenow @kuddlkuddl commentedon Oct 30, 2024
I "kind of fixed it", but do not know why it worked:
Even though the VSCode terminal said:
echo $SHELL->/bin/zshvfox was not poperly activated ...
I added the
bash activate(!) command to my .zshrc, and then it work as expected.So I have both commands in my .zshrc
I suspect, that something is missing in the zsh variant, that VSCode needs or looks for ...
But for now it works.
To @aooohan: Thanks a lot for the project! Maybe this hint / bug is helpful.
padulkemid commentedon Oct 30, 2024
by taking a look at the code, there are subtle differences between activating the shell in zsh and bash, 2 of this has the same commands but there are some quirks that made the same commands achieve different result, might something to do
linghengqian commentedon Oct 20, 2026
This still happens in 1.0.13 (main is still the v1.0.13 commit, b67f56e). When a login shell starts with vfox directories already in
PATH, macOSpath_helpermoves them behind/usr/local/bin,/usr/binand the other system directories, andvfox activatedoes not move them back to the front. That is the situation in a tmux pane or azsh -ltyped in a vfox shell. It is also the terminal in VS Code: a login shell on top of the environment VS Code resolved from a login shell at startup, or inherited from the shell that rancode(VS Code's terminal profiles FAQ describes the reordering). The$PATHin the reporter's second comment has the same shape.I checked on a GitHub-hosted macOS runner (macOS 26.6.2, arm64, zsh 5.9, the real
/usr/libexec/path_helper) with the release binaries of 0.5.4, 1.0.8, 1.0.10 and 1.0.13: https://github.com/linghengqian/vfox/actions/runs/39403641018. That is my fork's e2e job withscripts/e2e-test.shreplaced by this script. Everything starts fromenv -iand an interactive loginzsh, witheval "$(vfox activate zsh)"in~/.zshrcand global versions set beforehand for demonodejsandjavaSDKs (stub scripts in the install directories)./usr/bin/javais the real one. The runner's node is Homebrew's, so I put a stand-in at/usr/local/bin/node. A third demo SDK with no system counterpart resolved to vfox in every case, like kotlin and golang in the report.What
nodeandjavaresolve to (vfox: both from vfox's directories, system:/usr/local/bin/nodeand/usr/bin/java):zshin that shellThe VS Code row replays what VS Code does: at startup it runs
zsh -i -l -cwithVSCODE_RESOLVING_ENVIRONMENT=1and keeps that shell's environment, then the terminal is a loginzshon top of it. I did not run VS Code itself.The report's steps in the nested shell on 1.0.13, and its
PATH:In 0.5.4 and 1.0.8 the zsh hook skips everything in a shell that inherited its variables (0.5.4, 1.0.8), so the new shell gets neither a PATH export nor the precmd hook. c1ac36b (1.0.10, closes #637 and #655) compares the PID instead, and the hook is registered now. The order is still wrong, because
activate(L158) andenv(L305) keep whatever sits before the first vfox directory ahead of vfox's own (SplitSystemPaths, added in 717c219 for #622). Afterpath_helperthat is the whole systemPATH.With
eval "$(brew shellenv)"in~/.zprofile, the nested shell and the VS Code case resolvenodeto Homebrew's/opt/homebrew/bin/nodeon all four versions.Until this is fixed, dropping the inherited vfox directories before activating works around it:
On 1.0.10 and 1.0.13 it fixed the nested shell, the tmux pane and the VS Code case. It also fixed the nested shell and the VS Code case with
brew shellenvin~/.zprofile. With no vfox directory left inPATH,SplitSystemPathshas no prefix, soactivateputs the vfox directories first.My guess is that the directories
path_helperadds (/etc/pathsand/etc/paths.d) should not count as user-injected, so a virtualenv that really sits in front keeps its place. I have not tried it.feat: add `vfox doctor` and warn when a command is shadowed on PATH
feat: record the PATH at activation and add the `path.mode` setting
feat: link existing SDKs, add vfox doctor, aliases and path.mode (#736)
linghengqian commentedon Oct 23, 2026
#736 (merged, not released yet) adds a fix for this, but it has to be switched on:
$ vfox config path.mode baselineWith
baseline,vfox activaterecords the PATH it found, without vfox's own directories, and the entries in front of vfox's that were already in that PATH are moved behind vfox's. That is the case described in the comment above:path_helperputs/usr/local/bin,/usr/binand the other system directories in front of the vfox directories that a nested shell, a tmux pane or the VS Code terminal inherited.Checked with builds of v1.0.13 and
main, with a PATH shaped like the onepath_helperleaves behind (system directories first, vfox's after them). Which command runs aftervfox activate:main, defaultmain,path.mode baselineThe default stays
legacy(the behavior of 1.0.x), so nothing changes until the setting is switched on; whether and when the default changes is tracked in #737. In the default modevfox useandvfox doctornow say which directory comes first and why, for example`node` runs /usr/local/bin/node instead of [email protected]: its directory comes before vfox in PATH.baselineleaves one thing alone on purpose: a directory that was added to PATH aftervfox activateran, for exampleeval "$(brew shellenv)"placed below the vfox line in~/.zshrc, stays in front.vfox doctorreports it as added after activation and suggests activating vfox after that line, orpath.mode aggressive.A setting change applies at the next prompt, but
baselineneeds the PATH that was recorded when the shell started, so open a new terminal after upgrading. See PATH Order Settings. This stays open until a release containspath.mode.feat(config): make baseline the default path.mode (#738)
linghengqian commentedon Nov 10, 2026
Closed by v1.1.0:
baselineis now the defaultpath.mode(#738, released 2026-11-07).What this fixes here: when a login shell starts with vfox directories already in
PATH, macOSpath_helpermoves them behind/usr/local/bin,/usr/binand the other system directories (nested shell,zsh -lin a vfox shell, tmux pane, VS Code terminal). Withbaseline,vfox activaterecords thePATHit found (minus vfox's own directories) in__VFOX_ORIG_PATHand moves entries that were already there behind vfox's directories. Verified before the release with aPATHshaped the waypath_helperleaves it: v1.0.13 resolvesnode/javato the system copy,mainwithpath.mode baselineresolves them to vfox's copy.After upgrading, open a new terminal: a shell started before the upgrade has no recorded baseline and keeps behaving like
legacyuntil it is restarted. If only a few directories must stay in front, list them inpath.preserveinstead of switching back tolegacy.If this still reproduces on v1.1.0+ in a fresh terminal, please reopen with
vfox --version,vfox config path.mode,vfox doctor,echo $PATH, and which command resolves to the wrong binary.