Skip to content

Instantly share code, notes, and snippets.

@luckydev
Created September 24, 2010 08:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luckydev/595030 to your computer and use it in GitHub Desktop.
Save luckydev/595030 to your computer and use it in GitHub Desktop.
how to display ruby version and git branch in terminal prompt
export PS1="\[\033[00m\]\u@\h\[\033[00m\]:\[\033[00m\]\w\[\033[00m\] \`ruby -e \"print (%x{git branch 2> /dev/null}.split(%r{\n}).grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`\[\033[00m\]$\[\033[00m\] "
PS1="\$(~/.rvm/bin/rvm-prompt) $PS1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment