Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

~RVM_PROJECT_PATH in oh-my-zsh prompt

Tags:

oh-my-zsh

rvm

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.

like image 793
Don Pflaster Avatar asked Oct 14 '14 20:10

Don Pflaster


3 Answers

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

like image 167
mpapis Avatar answered Nov 06 '22 17:11

mpapis


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
like image 44
Sandeep M Avatar answered Nov 06 '22 17:11

Sandeep M


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.

like image 3
John Hinnegan Avatar answered Nov 06 '22 18:11

John Hinnegan