Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when pushing current directory (gem_home $PWD) #9

Open
AliSoftware opened this issue Nov 3, 2015 · 2 comments
Open

Issue when pushing current directory (gem_home $PWD) #9

AliSoftware opened this issue Nov 3, 2015 · 2 comments

Comments

@AliSoftware
Copy link

I wanted my GEM_HOME to be in ~/.gem so I put the call to gem_home $HOME in my .zshrc

But given that any new Terminal session already start in ~, then the pushd $HOME command executed by the gem_home_push function, realizing that I'm already in ~, doesn't add the current directory to the pushd stack.

As a result, when calling popd later on line 18, I get this error printed on my terminal:

gem_home_push:popd:18: directory stack empty

This doesn't actually cause any issue in my use case, but can still have consequences:

  • This message is annoying and could alarm people not really knowing what it means (one of my coworker to which I suggested using your script asked me "what does it mean, did I do something wrong?")
  • It could have side-effects when using outside of the rc file, like in the middle of a terminal session.

e.g. if the user used pushd on its own, then later calls gem_home . or gem_home $PWD, then the pushd won't add anything to the stack but the popd will pop to the last pushed directory and mess its pushd stack

~ $ pushd Documents
Documents $ gem_home .
~ $ # I expected to still be in Documents at this point
@adrianpacala
Copy link

Confirmed, really annoying bug 😦

@aleksandrs-ledovskis
Copy link

Looks to be same thing as in #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants