From cab14215b61dccb8ca3d26e1a092c539495a8db2 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 25 Nov 2013 18:23:12 +0900 Subject: [PATCH] update PS1 --- shrc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/shrc b/shrc index 17da7dc..7d47ac5 100755 --- a/shrc +++ b/shrc @@ -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 + if test "$1" -ne 0 + then + echo " " + fi } __my_alert_fail(){ - test $laststatus -eq 0 || echo '!!! ' + test $laststatus -eq 0 || \ + echo " " } # 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"