1

I installed prezto following this guide: http://codurance.com/2015/03/16/installing-zprezto-a-quick-guide/

If I start in a regular folder that's not in git, I see the current working directory as expected in the prompt.

~/Documents/projects/

As soon as I change to directory that's managed in git, the prompt changes to:

~RVM_PROJECT_PATH [feature/awesome]

where feature/awesome is my branch name.

No matter which prompt I configure to use, as soon as I navigate to a git repo, RVM_PROJECT_PATH shows up. How do I fix this?

Willam Hill
  • 1,572
  • 1
  • 17
  • 28

2 Answers2

3

Put this in your ~/.zshrc

unsetopt auto_name_dirs

Thanks to mcornella in this response: https://github.com/rvm/rvm/issues/3091#issuecomment-60083194

Tested in zsh 5.2 (x86_64-unknown-linux-gnu)

Rohanthewiz
  • 947
  • 9
  • 9
  • You can get into the details of this with: man zshexpn. See the accepted answer here http://superuser.com/questions/624603/zsh-auto-name-dirs-doesnt-work-for-certain-variable-names-on-osx – Rohanthewiz Feb 26 '16 at 18:39
  • Personally I will turn back on auto_name_dirs now that I understand what it's trying to do: " When the shell prints a path (e.g. when expanding %~ in prompts or when printing the directory stack), the path is checked to see if it has a named directory as its prefix. If so, then the prefix portion is replaced with a `~' followed by the name of the directory. It is also possible to define directory names using the -d option to the hash builtin." – Rohanthewiz Feb 26 '16 at 18:46
0

I was having this issue too and I was having an old version of prezto. Updating prezto (cd to ~/.zprezto && git pull && git submodule update --init --recursive) solved the issue thanks to this update in the ~/.zprezto/modules/ruby/init.zsh:

# Load RVM into the shell session.
if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
  # Unset AUTO_NAME_DIRS since auto adding variable-stored paths to ~ list
  # conflicts with RVM.
  unsetopt AUTO_NAME_DIRS

  # Source RVM.
  source "$HOME/.rvm/scripts/rvm"

  ...

# Prepend local gems bin directories to PATH.
else
  path=($HOME/.gem/ruby/*/bin(N) $path)
fi

ZedTuX
  • 2,859
  • 3
  • 28
  • 58