Prevent zsh from setting the current prompt to the name of the variable that points to this path

3

This is related to Open a new tab in the same directory. I have installed oh-my-zsh recently and it certainly kicks. I have some custom variables, like $WORKSPACE which I use to get around easily. And when I am inside one of those paths the prompt gets set to the name of the variable, for example ~WORKSPACE/project $ .
This breaks the "Open tab in the same directory feature" which I love so much. And whats puzzling me most here is that this does not happen for the ZSH variable. So cd $ZSH gives a prompt like ~/.oh-my-zsh $. And as far as I know they are bot set the same way in my .zshrc

ZSH=$HOME/.oh-my-zsh
WORKSPACE=$HOME/workspace

Paulo Casaretto

Posted 2012-09-06T19:53:04.570

Reputation: 421

Figured out as I was writing.

The problem was that I was setting the custom vars after oh-my-zsh was loaded. Moving them up solved the problem, but I still dont understand what happened. Maybe its a oh-my-zsh feature? – Paulo Casaretto – 2012-09-06T19:55:27.577

If you've answered your question, you should type it up as an "answer" below and accept it. It will be more useful to people that land here in the future. :) – JoshP – 2012-09-26T13:57:22.927

Oops, forgot to. SU had a time period before I could do that. – Paulo Casaretto – 2012-09-26T16:27:21.523

Answers

6

Oh-my-zsh was setting auto_name_dirs which caused this behaviour.
I just commented out that line from lib/directories.zsh and everything went back to the way I wanted them.

Paulo Casaretto

Posted 2012-09-06T19:53:04.570

Reputation: 421

So... is this the answer to the question? I still don't know how to prevent zsh from setting the current prompt to the name of the variable that points to this path... – Sebastián Grignoli – 2013-04-23T15:14:39.033

Updated the answer, thanks for bringing this up again. – Paulo Casaretto – 2013-04-23T16:24:41.123

Dont forget to vote me up! :) – Paulo Casaretto – 2013-04-23T18:05:42.830