15

It appears that I have autopushd turned on (I know I didn't turn it on) and it is rather annoying because I prefer to pick and choose when to use the directory stack. How can I turn off autopushd?

I have looked in ~/.zshrc and ~/.oh-my-zsh/oh-my-zsh.sh but couldn't find anything.

I am using oh-my-zsh on Mac OSX Lion.

knpwrs
  • 1,443

3 Answers3

12

It's set in ~/.oh-my-zsh/lib/directories.zsh. I would either comment it out there, or unset the options in your .zshrc after loading oh-my-zsh.

jhenninger
  • 1,731
6

Maybe you have the dirpersistplugin from oh-my-zsh loaded or perhaps you are sourcing some kind of $ZDOTDIR/z.* at startup. Have a look at the manpage for startup files.

Just type unsetopt autopushd to disable the feature for the current session and setoptto verify that it is really unloaded.

To find the source of the problem I would run zsh -x 2> log, exit immediately and inspect the context of every pushd in the log...

Sebastian Stumpf
  • 684
  • 6
  • 11
0

Just run this and logout and log back in

echo "unsetopt autopushd">>~$USER/.zshrc

This will append the line to the very end of your .zshrc (after the loading of oh-my-zsh) so that it overrides whatever oh-my-zsh does.

Logging out ends all zsh-sessions so that when you log back in, all new sessions have the option unset. (You could also kill all zsh-sessions in other ways.)

grepit
  • 253