Skip to content

Instantly share code, notes, and snippets.

@cpsubrian
Created February 12, 2013 23:31
Show Gist options
  • Save cpsubrian/4774500 to your computer and use it in GitHub Desktop.
Save cpsubrian/4774500 to your computer and use it in GitHub Desktop.
My Terminal Prompt
# GIT Prompt
parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
WHITE="\[\033[1;37m\]"
GREEN="\[\033[0;32m\]"
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
B_YELLOW="\[\033[1;33m\]"
GREY="\[\033[0;39m\]"
MAGENTA="\[\033[0;35m\]"
CYAN="\[\033[0;36m\]"
NOCOLOR="\[\033[0m\]"
export PS1="$GREEN\u@\h $YELLOW\w$B_YELLOW\$(parse_git_branch) $WHITE\n$ $NOCOLOR"
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME} : ${PWD}\007"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment