Skip to content

Instantly share code, notes, and snippets.

@CJBridges
Last active August 29, 2015 14:14
Show Gist options
  • Save CJBridges/a71eb1678e75f66d3d0c to your computer and use it in GitHub Desktop.
Save CJBridges/a71eb1678e75f66d3d0c to your computer and use it in GitHub Desktop.
This is a favorite prompt of mine.
. /Library/Developer/CommandLineTools/usr/share/git-core/git-prompt.sh # for git_ps1 below
my_prompt() {
if [ $? -eq 0 ]; then
RC=""
RC_COLOR_FOR_PROMPT=$DF
else
RC="[$?]"
RC_COLOR_FOR_PROMPT=$RED
fi
export PS1="\n\h:\[\e[0;32m\]\w$DF$(__git_ps1)\n[\u]$RC_COLOR_FOR_PROMPT$RC$DF\$ "
}
export PROMPT_COMMAND=save_rc_for_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment