use node $VERSION
remains in effect even after I leave a directory
#1269
Labels
use node $VERSION
remains in effect even after I leave a directory
#1269
Describe the bug
If I have
use node 1.2.3
in a .envrc file, I would expect that to take effect when I enter the directory, but to be undone when I go back to the parent dir. This isn't the case, it is "sticky" and remains in effect.To Reproduce
Create a directory containing a .envrc file something like this. The precise node version doesn't matter:
Before entering that directory
nvm use 20
(or some other version, just not the same as in the .envrc), then confirm thatnode -v
andnvm which current
show the correct version.Then enter the directory. direnv should say something like
direnv: using node 16
, which can be confirmed usingnode -v
andnvm which current
again.Go back to the parent directory using
cd -
.node -v
andnvm which current
will still show the version of node from the previous directory's .envrc.Expected behavior
After
cd -
I expect the version of node to also be restored.Environment
Additional context
The stdlib appears to implement
use node $VERSION
by callingload_prefix
to twiddle paths, and not by runningnvm use $VERSION
so I would expect that the paths would be automatically untwiddled just as happens for any other env vars that are altered in .envrc.The text was updated successfully, but these errors were encountered: