Re:Command Line Feedback from RVM and Git
by glenjamin on Tuesday August 02, 2011 @02:48PM
(#2838265)
Here's the bash incantation for that:
command_exists __git_ps1 && git="$c_vcs\$(__git_ps1)"
PS1="\n$c_path\w$git $c_id\u@$prompt_host$c_reset"
$c_* vars are just for colour, the command_exists switch lets me use the same dotfile on boxes which don't have git installed.I use the same except my 2nd line has history id and time:
136 11:33:48 $
export PS1='\[\e[32m\]\u@\h \[\033[33m\]\w\[\033[00m\] $(__git_ps1 "(%s)") ${rvm_ruby_string}\n\# \[\033[31m\] \[\033[00m\]\t \\$ '
I have one info line which tells me path, user, host, git branch etc. And then the prompt sits nicely on the line below and is always at the same alignment.
http://i.imgur.com/0F6qt.png