Ethan
Ethan

Reputation: 60099

How can I get Zsh to display the RVM gemset?

I'd like to have Zsh diplay the current RVM Ruby and gemset, for instance:

$ [ ethan@devlaptop ~/ ruby-1.9.3-p194@some_gemset ]

I've installed oh-my-zsh and I've activated the RVM plugin in my ~/.rvmrc like this:

plugins=(git ruby rails3 rvm cap)

I checked that RVM is working as recommended in the docs:

type rvm | head -n 1
rvm is a shell function

In a theme file I have my prompt set up like this:

PROMPT='%{$fg[white]%}[ %n@%m%{$fg[cyan]%} %2c %{$reset_color%}${rvm-prompt} %{$fg[white]%}] %{$reset_color%}'

But the prompt just turns out to be this:

[ ethan@devlaptop ~ prompt ]

When I directly run rvm-prompt on the command line, it works as expected.

Any idea what I need to fix?

Upvotes: 5

Views: 1757

Answers (2)

mpapis
mpapis

Reputation: 53158

This sounds like a bug. Bugs should be reported to the developer, not to S.O.

https://github.com/wayneeseguin/rvm/issues/new

Upvotes: 0

Ethan
Ethan

Reputation: 60099

It was a syntax error. I needed $(rvm-prompt) instead of ${rvm-prompt}.

Upvotes: 6

Related Questions