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
inside .zshrc I autoset node version using nvm preload script
# Auto load .nvmrc file
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
fi
elif [ "$node_version" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
it works fine and each time when I open projects it's auto load node version
Error
but when I run Test debug command using integratedTerminal it is somehow not waiting until the terminal is loaded. so it mixed the script code with nvm switching info
It just can't start the debugger =(
How it works
When I run debug command without "console": "integratedTerminal", then it works.
Also, it works if I comment preload nvm script inside .zshrc (doesn't looks like a good solution)
Looks like debug command can't wait until zsh finishes hooks and I guess we should somehow fix it
The text was updated successfully, but these errors were encountered:
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.76.2. Please try upgrading to the latest version and checking whether this issue remains.
I would have expected that the echo is not actually interfering with the input, even if it looks like the next is messed up in the terminal
However you say
Also, it works if I comment preload nvm script inside .zshrc (doesn't looks like a good solution)
So there is probably something going on.
I think there is also still an open issue about a character limit when sending lots of text into the terminal, that we bump into sometimes when debugging in the terminal with a very long command, and maybe that is in play here as well.
I also wouldn't expect the echo to cause any problems, my guess is nvm is swallowing some input. Currently for new terminals they are given 1 second to initialize so you could maybe speed up start up to get it to work again? Though my experience with nvm is it's really slow.
I don't think there is anything we can do apart from debug to use some shell integration hooks for when the shell is initialized, that's a bigger feature though and depends #145234
Steps to Reproduce:
it works fine and each time when I open projects it's auto load node version
Error
but when I run Test debug command using integratedTerminal it is somehow not waiting until the terminal is loaded. so it mixed the script code with nvm switching info
It just can't start the debugger =(
How it works
When I run debug command without "console": "integratedTerminal", then it works.
Also, it works if I comment preload nvm script inside .zshrc (doesn't looks like a good solution)
Looks like debug command can't wait until zsh finishes hooks and I guess we should somehow fix it
The text was updated successfully, but these errors were encountered: