Skip to content

Instantly share code, notes, and snippets.

@czarneckid
Created October 14, 2011 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save czarneckid/1287184 to your computer and use it in GitHub Desktop.
Save czarneckid/1287184 to your computer and use it in GitHub Desktop.
Colorizing my BASH prompt
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ →\ \1/'
}
export PS1='\[\e[1;37m\][\[\e[1;35m\]\u\[\e[1;37m\]@\[\e[1;32m\]\h\[\e[1;37m\]:\[\e[1;36m\]\w\[\e[1;33m\]$(parse_git_branch)\[\e[1;37m\]]$ \[\e[0m\]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment