Closed dmitry-kabanov closed 7 years ago
It would be great/helpful if you could create a failing test for that (in a PR).
But (from only skimming it) it sounds like stashing only supports one level?!
@blueyed What do you mean by "a failing test"? Something simpler, which can be run by others?
@dmitry-kabanov
There's a test suite - please look into tests/*.t
.
The problem is that the current dir during the "leave" event is the new dir, and therefore the "unstash" does not find the expected old value (which is based on the directory).
(see 986a760)
https://github.com/Tarrasch/zsh-autoenv/pull/72 should fix this, by setting varstash_dir
when sourcing the "leave" file.
However, using autostash
/ autounstash
should have worked before already.
I have the following bug.
I try to stash two paths to $PATH. I will call them below like this:
code/bin
is my custom path (in the log below it is/home/kabanod/job/ffm/shock-attached/code/bin
)python/bin
is path to python interpreter (in the log below it is/home/kabanod/apps/python/3.4/bin
)What do I do? In
.autoenv.zsh
I prepend$PATH
with the path to thepython/bin
directory using Environment Modules command (module load python/3.4
) and then prepend $PATH withcode/bin
path (usingstash
command). In.autoenv_leave.zsh
I unstash$PATH
from mycode/bin
path and then unloadpython/bin
path.Expected behavior. Both paths are removed from
$PATH
.What happens.
python/bin
path is removed from$PATH
, however, an explicit call tostash
doesn't removecode/bin
path from$PATH
.I also tried to use
autostash
functionality with no success.This is the full log: