Browse Source

update PS1

pull/1/head
10sr 11 years ago
parent
commit
cab14215b6
1 changed files with 10 additions and 6 deletions
  1. +10
    -6
      shrc

+ 10
- 6
shrc View File

@@ -1144,8 +1144,7 @@ test -n "$__MY_DTACH" && __my_ps1_str="${__my_ps1_str}${__my_c5}DTACH${__my_cdef
__my_ps1_scale(){
if null type stty && ! ismsys
then
stty size | tr -d $'\n' | tr " " x
printf " "
echo "[LxC:`stty size | tr -d $'\n' | tr " " x`]"
fi
}

@@ -1193,11 +1192,16 @@ __my_ps1_dirs(){
}

__my_ps1_jobs(){
jobs | wc -l
# __my_ps1_jobs <num>
if test "$1" -ne 0
then
echo "<JOBS:$1> "
fi
}

__my_alert_fail(){
test $laststatus -eq 0 || echo '!!! '
test $laststatus -eq 0 || \
echo "<STATUS:${laststatus}> "
}

# About ansi escape sequences
@@ -1268,8 +1272,8 @@ then
fi

_ps1_bash="\
${__my_c4}:: ${__my_cdef}[${__my_c2}\u@\H${__my_cdef}:${__my_c1}\w/${__my_cdef}]\$(__my_ps1_git)\$(__my_ps1_bttry)\$(__my_ps1_ipaddr)\$(__my_ps1_moc)\n\
${__my_c4}:: ${__my_cdef}l${SHLVL}n\#j\js\$laststatus $(__my_ps1_scale)\D{%T} ${__my_ps1_str}\$(__my_alert_fail)\$ "
${__my_c4}:: ${__my_cdef}[${__my_c2}\u@\H${__my_cdef}:${__my_c1}\w/${__my_cdef}]\$(__my_ps1_scale)\$(__my_ps1_git)\$(__my_ps1_bttry)\$(__my_ps1_ipaddr)\$(__my_ps1_moc)\n\
${__my_c4}:: ${__my_cdef}\$(__my_ps1_jobs \j)${__my_ps1_str}\$(__my_alert_fail)\$ "
inbash && PS1=$_ps1_bash
_ps1_zsh="$_ps1_bash"
#inzsh && PS1="$_ps1_zsh"


Loading…
Cancel
Save