5 ms·
I too dislike that, which is why I've been using fnm and conditionally execing its initialization env vars when I want it. The idea of subshells instead is int
by jacobmischka 5y ago
I too dislike that, which is why I've been using fnm and conditionally execing its initialization env vars when I want it.
The idea of subshells instead is interesting, I might write a quick wrapper function that does that instead, thanks.
Nave seems interesting, and of course isaacs is well known, but taking a look at its primary source file that is just a massive shell script makes me slightly uneasy, I'd rather use something written in a proper language.
- andrewla 5y agoFor a while I had a wrapper script around nvm (that I called "nvm-shell") that let me swap in a shell that was aware of nvm: exec $BASH --init-file <(echo '. ~/.bashrc; . $NVM_DIR/nvm.sh; PS1="<nvm>$PS1"') This worked for me, but it's so ugly. When I found nave I switched over. I do wish bash had some sort of functionality for "after you do the standard initialization, run this script and then be interactive after that". This was the best I could do on that front. I suppose it might be worth having a more generic tool -- "launch_interactive_shell_session_after_executing_script" that could be reused here. The fact that nave is done entirely in shell script is admittedly a bit terrifying. Really the best option is just to use nix (and thus nix-shell) for this, but I work in some environments where nix is not yet an option.