Created
March 2, 2018 18:34
-
-
Save nickavv/c5c63694ed4a0bbb0bce690bfba3f4f7 to your computer and use it in GitHub Desktop.
A nicely colored bash prompt for Mac with current git branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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