Created
October 18, 2013 14:41
-
-
Save rawfalafel/7042558 to your computer and use it in GitHub Desktop.
bash prompt
This file contains hidden or 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
export PS1="\[\e[35m\]\u@\h\[\e[0m\]:\[\e[35m\]\W" | |
export PS1=$PS1'$(__git_ps1 "\[\e[32m\]{%s}")\[\e[0m\]$ ' | |
export _PS1=$PS1 | |
__git_ps1 () | |
{ | |
local b="$(git symbolic-ref HEAD 2>/dev/null)" | |
if [ -n "$b" ]; then | |
if [ -n "$1" ]; then | |
printf "$1" "${b##refs/heads/}" | |
else | |
printf " (%s)" "${b##refs/heads/}" | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment