Skip to content

Instantly share code, notes, and snippets.

@squarism
Created December 2, 2011 15:00
Show Gist options
  • Save squarism/1423532 to your computer and use it in GitHub Desktop.
Save squarism/1423532 to your computer and use it in GitHub Desktop.
sstephenson's prompt from rbenv README
# sstephenson's prompt from rbenv
# - Set your Terminal.app theme to Basic
# - Set your Terminal.app font to 13pt Inconsolata
# - Set your ANSI Color for Normal White(7) to Tin (Crayons tab in color picker)
# - Put this at the end of your .profile
# - Help me figure out what his exact font is because it's not Inconsolata.
function parse_git_dirty {
[[ $(git status 2> /dev/null \
| tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null \
| sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1$(parse_git_dirty))/"
}
export PS1='\[\033[37m\]\w$(parse_git_branch)$\[\033[0m\] '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment