Skip to content

Instantly share code, notes, and snippets.

@mlangenberg
Created September 9, 2008 15:40
Show Gist options
  • Save mlangenberg/9695 to your computer and use it in GitHub Desktop.
Save mlangenberg/9695 to your computer and use it in GitHub Desktop.
function parse_git_branch {
ref=$(git-symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
function proml {
local LIGHT_GRAY="\[\033[0;37m\]"
case $TERM in
xterm*)
TITLEBAR='\[\033]0;\u@\h:\w\007\]'
;;
*)
TITLEBAR=""
;;
esac
PS1="${TITLEBAR}\
\h:\w$LIGHT_GREEN\$(parse_git_branch)$LIGHT_GRAY\
\$ "
PS2='> '
PS4='+ '
}
proml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment