Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get Zsh to display the RVM gemset?

Tags:

shell

zsh

rvm

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?

like image 455
Ethan Avatar asked Sep 28 '12 22:09

Ethan


1 Answers

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

like image 200
Ethan Avatar answered Nov 15 '22 08:11

Ethan