Created
July 6, 2017 00:25
-
-
Save clintliang/03fbf0fe9183d5f3f37f58c956c8e29e to your computer and use it in GitHub Desktop.
colorful bash path PS1 with git branch name
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
# path format | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\e[91m\u\e[33;40m@\H:\[\033[32m\]\w\[\033[36m\]\$(parse_git_branch)\[\033[00m\] $ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment