public
Last active

Stick this in your bashrc and don't wonder what branch/ruby/gemset you're using

  • Download Gist
.bashrc
Shell
1 2 3 4 5
# Git and RVM prompting
function git-current-branch {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
export PS1="[\$(~/.rvm/bin/rvm-prompt v p g)] \$(git-current-branch)$PS1"

After several abortive attempts because I'm bash-challenged, this seems to work as you'd expect.

Makes my prompt look like:

[1.9.3-p125] (master) mazikeen:./metasploit-framework$

Hrm, rvm-prompt may not work any more. Oh well, it's not like we're doing a lot of ruby version changing any more these days.

As of today, it looks like rvm-prompt once again functions correctly.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.