You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
I wanted my
GEM_HOME
to be in~/.gem
so I put the call togem_home $HOME
in my.zshrc
But given that any new Terminal session already start in
~
, then thepushd $HOME
command executed by thegem_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:This doesn't actually cause any issue in my use case, but can still have consequences:
rc
file, like in the middle of a terminal session.e.g. if the user used
pushd
on its own, then later callsgem_home .
orgem_home $PWD
, then thepushd
won't add anything to the stack but thepopd
will pop to the last pushed directory and mess its pushd stackThe text was updated successfully, but these errors were encountered: