Skip to content

Instantly share code, notes, and snippets.

@johnbintz
Created July 27, 2010 14:28
Show Gist options
  • Save johnbintz/492294 to your computer and use it in GitHub Desktop.
Save johnbintz/492294 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/}")"
}
export PS1="\[\e[0;37m\][\[\e[0;31m\]\u\[\e[1;37m\]@\[\e[0;32m\]\h\[\e[0;37m\]] \[\e[1;37m\]\w\$(parse_git_branch) \$ \[\e[0;37m\]"
[[ "${TERM}" == "screen" ]] && echo -n -e '\ek'${HOSTNAME%%.*}'\e\'
@johnbintz
Copy link
Author

For those who want to make their prompts look like mine. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment