bash - How do I display RVM's current Ruby and gemset in the Terminal prompt? -


i'm using rvm-prompt. seems interpreter, version, patchlevel, , gemset should displayed default.

if call prompt, accurately returns current ruby , gemset:

$ rvm-prompt ruby-1.8.7-p302@rails125 

but gemset isn't reflected in prompt:

ruby-1.8.7-p302 macbook:~ subpixel$  

i tried calling gemset explicitly in .bash_profile with:

ps1="\$(~/.rvm/bin/rvm-prompt v p g) $ps1" 

but doesn't change prompt.

if @ documentation rvm-prompt, @ bottom of page you'll find following:

ps1_functions

recently there has been pair programming session turned out useful bit of prompt setting code. resides in contrib/ can require in profiles follows after sourcing rvm itself.

source "$rvm_path/contrib/ps1_functions" 

immediately after can customize prompt adding following line

ps1_set 

there article , screen cast associated in community resources section.

i copied ps1_functions file, changed suit needs , source in .bash_profile. have line calls

ps1_set 

now prompt changes when change gemsets


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -