Recently installed .oh-my-zsh on a new machine on which RVM was already installed.
Noticed that in several of my Rails project directories, I now see this instead of the actual name of the project directory:
➜ ~RVM_PROJECT_PATH git:(master)
All other behavior seems normal, but I'm finding it difficult to pin down the cause in the .oh-my-zsh configuration.
it is a bug in your Zsh, to avoid it use %1/
in PROMPT
instead of %.
or %C
or %1~
more info: https://github.com/wayneeseguin/rvm/issues/3091
this bug should be fixed in zsh 5.0.7
... or with this https://github.com/robbyrussell/oh-my-zsh/pull/3252
oh-my-zsh has been updated to fix this issue. Forcing an upgrade of oh-my-zsh fixed the problem for me.
$ source ~/.oh-my-zsh/tools/upgrade.sh
So, I was really struggling with this for a while. I'm not using oh-my-zsh, just straight zsh, but had the same issues. Upgraded a lot of stuff. After digging through this huge script and trying lots of suggestions, this finally worked for me:
hash -rd
I just put this before I set my variable holding the directory. My config now looks like this:
30 hash -rd
31 local promptsize=${#${():---(${PR_GEMSET}${PR_BRANCH})---()--}}
32 local pwdsize=${#${(%):-%~}}
Note that the issue was with the %~
. Just thought I'd share what worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With