Created
May 8, 2015 06:46
-
-
Save caad1229/f6c64ef41d58f15f5148 to your computer and use it in GitHub Desktop.
customized PS1
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]/' | |
} | |
function promps { | |
local BLUE="\[\e[1;34m\]" | |
local RED="\[\e[1;31m\]" | |
local GREEN="\[\e[1;32m\]" | |
local WHITE="\[\e[00m\]" | |
local GRAY="\[\e[1;37m\]" | |
case $TERM in | |
xterm*) TITLEBAR='\[\e]0;\W\007\]';; | |
*) TITLEBAR="";; | |
esac | |
local BASE="\u@\h" | |
PS1="${TITLEBAR}${GREEN}${BASE}${WHITE}:${BLUE}\W${GREEN}\$(parse_git_branch)${BLUE}\$${WHITE} " | |
} | |
promps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment