Skip to content

Instantly share code, notes, and snippets.

@13k
Created June 23, 2010 19:58
Show Gist options
  • Save 13k/450459 to your computer and use it in GitHub Desktop.
Save 13k/450459 to your computer and use it in GitHub Desktop.
# see it in action: http://yfrog.com/49ydhp
minimal_prompt_command() {
if [ $? -eq 0 ]; then
local ARROW_COLOR="\[\e[1;32m\]"
else
local ARROW_COLOR="\[\e[1;31m\]"
fi
local CWD_GIT_BRANCH="`git symbolic-ref HEAD 2> /dev/null | sed -e 's#refs/heads/##'`"
PS1="\n\[\e[1;30m\] +\[\e[0m\] \[\e[1;34m\]\w\[\e[1;37m\] $CWD_GIT_BRANCH\[\e[0m\]\n$ARROW_COLOR~>\[\e[0m\] "
}
PROMPT_COMMAND="minimal_prompt_command"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment