I noticed that several programs (ie webstorm) run with their own manager, and thus through the login shell (running through the jetbrains toolbox to manage versions and updates smoothly), which I cannot realistically change.
Now webstorm uses javascript, and I use nvm to manage node versions. However I also noticed that nvm only "works" in the bash shell, its settings being located in .bashrc. Which meant that webstorm doesn't understand the current version or what node will alias to.
Googling learned me that I can "fix" this by adding the following lines to ~/.profile
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Which indeed worked. Yet now when I try to upen a new terminal/shell (either directly, or inside webstorm terminal) I notice that each time I change the node version nvm use xyz the change doesn't persist.
The next time I login, or even the next time I open the shell, it's back to the old version.
If I remove the three lines above and reboot my pc it does work again.
This lead me to believe that the "login shell nvm" is overwriting the current interface shell bash, and hence I should directly tap into that shell and update nvm through there?
Am I correct in believing that? And if so, how can I do that, is that even possible?