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
Issues running in VS Code integrated terminal vs Terminal.app on macOS #245
I'm running into what appears to be a similar issue as #242 within the VS Code integrated terminal, but everything is fine in Terminal.app. I'm unclear on what the differences are between the VS Code environment (or tmux environment) and Terminal.app. The error message being printed mirrors what @redsuperbat is seeing.
The following commands produce different output in the two environments, specifically for the nvm_current_version variable. I believe I'm up to date on fish/fisher/nvm.
Terminal.app
ritchie@chonkers ~>set-S|grep nvm_current_version
$nvm_current_version: setin global scope, exported, with 1 elements
$nvm_current_version[1]: |v22.17.1|
ritchie@chonkers ~> fish --version
fish, version 4.0.2-gf1456f9
ritchie@chonkers ~> fisher --version
fisher, version 4.4.5
ritchie@chonkers ~> nvm --version
nvm, version 2.2.18
ritchie@chonkers ~>
VS Code.app
ritchie@chonkers ~>set-S|grep nvm_current_version
$nvm_current_version: setin global scope, exported, with 1 elements
$nvm_current_version[1]: |v22.17.1|$nvm_current_version: originally inherited as |v22.17.1|
ritchie@chonkers ~> fish --version
fish, version 4.0.2-gf1456f9
ritchie@chonkers ~> fisher --version
fisher, version 4.4.5
ritchie@chonkers ~> nvm --version
nvm, version 2.2.18
ritchie@chonkers ~>
config.fish:
set-gx nvm_default_version lts
When conf.d/nvm.fish is loaded by fisher (?), nvm_current_version has already been set by something that VS Code then inherited, and the initial nvm use --silent $nvm_default_version is never executed. if I update that block to the following, everything seems to now work in VS Code and Terminal.app.
I went chasing all over various dotfiles as well as VSCode's settings.json and I don't see where nvm_current_version is being set upstream of fish initialization, and why it would be inherited to VS Code and not Terminal.app.
Is there any issue unsetting nvm_current_version in the conf.d/nvm.fish file? I'm not super clear on initialization order of fish/fisher.
changed the title [-]Issues running in VS Code terminal vs Terminal.app on macOS[/-][+]Issues running in VS Code integrated terminal vs Terminal.app on macOS[/+]on Jul 26, 2025
I am having the same problem using Zed on Arch Linux, where nvm_current_version is always being set to system (which is node@latest due to package dependencies). In the integrated terminal (which is Alacritty), I always experience this behavior, while in Ghostty I do not.
a) That does not work for me, it still "falls back" to the system version.
b) This would only have been a workaround for me, as it would be annoying to be forced to go into config.fish and change the version every time you update Node
c) The only thing that works for me is the following:
➜ set-e nvm_current_version && nvm use 24.15.0
Now using Node v24.15.0 (npm 11.13.0) ~/.local/share/nvm/v24.15.0/bin/node
I have to do that on every new shell that opens up, which is very annoying (although you get used to it after some time).
Same here with Zed on macOS (fish 4.9.3, nvm.fish from main, Zed 1.25.3). I think I found the cause.
Cause. When Zed starts from the Dock, it captures the environment by running fish -l -i -c '…; zed --printenv' (shell_env.rs). That shell is interactive, so conf.d/nvm.fish runs nvm use and exports nvm_current_version. Zed then passes this variable to every terminal it opens.
In the terminal, the new login fish rebuilds PATH, and fish_user_paths (here it has /opt/homebrew/bin) goes to the front. Then conf.d/nvm.fish sees that nvm_current_version is already set and skips nvm use. So the nvm bin dir stays behind Homebrew, and node is Homebrew's. In Ghostty the variable is not inherited, so nvm use runs and nvm wins.
Repro (no Zed needed):
env-i HOME=$HOME TERM=xterm nvm_current_version=v26.10.0 \
PATH=/usr/bin:/bin:/opt/homebrew/bin:$HOME/.local/share/nvm/v26.10.0/bin \
fish -l-i-c'type -a node'# node is /opt/homebrew/bin/node <- first
Workaround. This puts the inherited version back at the front, so you don't need to hardcode a version:
The same thing likely happens in any fish started from another fish-spawned process (VS Code, WebStorm, tmux). A possible fix in nvm.fish itself: in conf.d/nvm.fish, when nvm_current_version is inherited, move its bin to the front of PATH instead of skipping it.
Activity
[-]Issues running in VS Code terminal vs Terminal.app on macOS[/-][+]Issues running in VS Code integrated terminal vs Terminal.app on macOS[/+]thewirv commentedon Apr 2, 2026
I am having the same problem using Zed on Arch Linux, where
nvm_current_versionis always being set tosystem(which isnode@latestdue to package dependencies). In the integrated terminal (which is Alacritty), I always experience this behavior, while in Ghostty I do not.evaporei commentedon May 9, 2026
I had to add this to
~/.config/fish/config.fish.Switch
defaultwith whatever version you use.jorgebucaran commentedon May 11, 2026
Yeah, that should do the trick 👍
thewirv commentedon May 12, 2026
a) That does not work for me, it still "falls back" to the
systemversion.b) This would only have been a workaround for me, as it would be annoying to be forced to go into
config.fishand change the version every time you update Nodec) The only thing that works for me is the following:
I have to do that on every new shell that opens up, which is very annoying (although you get used to it after some time).
damner commentedon Oct 24, 2026
Same here with Zed on macOS (fish 4.9.3, nvm.fish from
main, Zed 1.25.3). I think I found the cause.Cause. When Zed starts from the Dock, it captures the environment by running
fish -l -i -c '…; zed --printenv'(shell_env.rs). That shell is interactive, soconf.d/nvm.fishrunsnvm useand exportsnvm_current_version. Zed then passes this variable to every terminal it opens.In the terminal, the new login fish rebuilds
PATH, andfish_user_paths(here it has/opt/homebrew/bin) goes to the front. Thenconf.d/nvm.fishsees thatnvm_current_versionis already set and skipsnvm use. So the nvmbindir stays behind Homebrew, andnodeis Homebrew's. In Ghostty the variable is not inherited, sonvm useruns and nvm wins.Repro (no Zed needed):
Workaround. This puts the inherited version back at the front, so you don't need to hardcode a version:
The same thing likely happens in any fish started from another fish-spawned process (VS Code, WebStorm, tmux). A possible fix in nvm.fish itself: in
conf.d/nvm.fish, whennvm_current_versionis inherited, move itsbinto the front ofPATHinstead of skipping it.