Created
May 28, 2013 20:50
-
-
Save ojacobson/5666019 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. /usr/local/git/contrib/completion/git-completion.bash | |
. "$HOME/Console/git/git-prompt.sh" | |
GIT_PS1_SHOWDIRTYSTATE=true | |
GIT_PS1_SHOWUNTRACKEDFILES=true | |
ps1_status() { | |
if [ $? -ne 0 ]; then | |
echo ":(" | |
else | |
echo ":)" | |
fi | |
} | |
function configure_prompt() { | |
local PS_RESET="\[\e[00m\]" | |
local PS_RED="\[\e[01;31m\]" | |
local PS_GREEN="\[\e[01;32m\]" | |
local PS_BLUE="\[\e[01;34m\]" | |
local PS_PURPLE="\[\e[01;35m\]" | |
# No \[ \] - makes it too hard to verify the pairing to put them here. | |
# See TITLEBAR below. | |
local PS_TITLE_START="\e]0;" | |
local PS_TITLE_END="\a" | |
case $TERM in | |
xterm*|rxvt) | |
local TITLEBAR="\[$PS_TITLE_START\u@\h:\W$PS_TITLE_END\]" | |
;; | |
*) | |
local TITLEBAR='' | |
;; | |
esac | |
local IDENT="$PS_GREEN\u@\h$PS_RESET" | |
local CWD="$PS_BLUE\W$PS_RESET" | |
local SMILEY="$PS_PURPLE"'$(ps1_status)'"$PS_RESET" | |
local GITPROMPT="$PS_RED"'$(__git_ps1)'"$PS_RESET" | |
local PROMPT="$SMILEY$IDENT:$CWD$GITPROMPT\$ " | |
export PS1="$TITLEBAR$PROMPT" | |
} | |
configure_prompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment