A bit more subtle. More informative, too. Probably slower, though. dunno.

This commit is contained in:
Dan Buch 2012-03-14 20:10:37 -04:00
parent 5ab0c31420
commit a87973d159

View File

@ -211,12 +211,22 @@ function rss_pid_command(){
}
function exit_status() {
if [[ $1 -eq 0 ]]; then
echo "\[\033[1;32m\]✓\[\033[00m\]"
else
echo "\[\033[1;31m\]✗\[\033[00m\]:\[\033[31m\]$1\[\033[00m\]"
fi
}
function precmd(){
PS1="\[\033[01;32m\]\u@\h\[\033[00m\]⋮\[\033[01;32m\]"
last_status=$?
PS1="\[\033[1;32m\]\u@\h\[\033[00m\]:\[\033[1;32m\]"
PS1="$PS1$(trunc_pwd)\[\033[00m\] "
local pcla="$(which print-color-loadavg 2>/dev/null)"
test -n "$pcla" && test -x $pcla && PS1="$PS1$(print-color-loadavg)"
PS1="$PS1$(__git_ps1 "⎛%s⎠")\n≻ "
test -n "$pcla" && test -x $pcla && PS1="$PS1-$(print-color-loadavg)- "
PS1="$PS1$(__git_ps1 "(%s)")\n$(exit_status $last_status) "
if [ -n "$1" ]
then