I noticed a small bug annoying for people having the habit of using cd -. It is used to switch back to the previous directory. Your function is using some cd that are not done in a subshell – not within (...) or $(...) – and because of this the shell keep trace of all visited folders within the function.
To reproduce:
Preparation
mkdir -p ~/TEMPFOLDER
cd ~/TEMPFOLDER
mkdir AAA BBB
Normal case
cd ~/TEMPFOLDER
cd AAA
cd - # Go back to TEMPFOLDER
cd - # Go back to AAA
cd - # Go back to TEMPFOLDER
cd - # Go back to AAA
# Etc...
Wrong case
cd ~/TEMPFOLDER
cd AAA
cd - # Go back to TEMPFOLDER -> OK
k
cd - # Go back to BBB -> not what i want...
I tried to look for correcting it, but the construction of the code doing the cd doesn't allow an easy fix, at least up to my knowledge. I can contribute if needed but before taking time on it I decided to open this issue to discuss the best way to solve it.
Hi,
Thanks for your plugin, it's amazing.
I noticed a small bug annoying for people having the habit of using
cd -
. It is used to switch back to the previous directory. Your function is using somecd
that are not done in a subshell – not within(...)
or$(...)
– and because of this the shell keep trace of all visited folders within the function.To reproduce:
Preparation
Normal case
Wrong case
I tried to look for correcting it, but the construction of the code doing the
cd
doesn't allow an easy fix, at least up to my knowledge. I can contribute if needed but before taking time on it I decided to open this issue to discuss the best way to solve it.