A bit more subtle. More informative, too. Probably slower, though. dunno.
This commit is contained in:
parent
5ab0c31420
commit
a87973d159
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user