Skip to content

Instantly share code, notes, and snippets.

@nickavv
Created March 2, 2018 18:34
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 nickavv/c5c63694ed4a0bbb0bce690bfba3f4f7 to your computer and use it in GitHub Desktop.
Save nickavv/c5c63694ed4a0bbb0bce690bfba3f4f7 to your computer and use it in GitHub Desktop.
A nicely colored bash prompt for Mac with current git branch
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\[\1\]/'
}
export PS1="\[\e[00;36m\]\u@\h:\[\e[0m\]\[\e[00;35m\]\w\[\033[0;31m\]\$(parse_git_branch)\[\e[00;35m\]\\$\[\e[0m\] "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment