Add directory stack to cd#145
Conversation
|
Thanks for the contribution 👍 I need to do more research to see how the directory stack works in other shells, but from the top of my mind they usually also have |
|
When reading more about directory stack in other shells I also learned that I have a question, do you just use cd to jump to last directory or do you use the functionality to jump to a directory deeper in the stack? I try not to blindly copy every feature and personally have never used the directory stack. Comments to the proposed implementation:
ConlusionI see two options:
@tramzee Would 1) be enough to cover your usage? Sources: |
|
@dundalek I use the directory stack deeper than just one. However, I would say that 90% of my usage is |
|
Also, I would be willing to tale a cut at doing the full directory stack implementation (pushd, popd, and dirs). |
|
@tramzee Cool, that makes sense. I am also interested in having the full dir stack implementation, so that would be great. FYI I refactored the built-ins a bit so that they are now defined with |
I like to use
cd -to flip back and forth between two directories.This implements a very rudimentary directory stack that allows an easy way to return to a previous directory. It also adds a
dhcommand that allows one to view the stack.