|
@@ -454,6 +454,14 @@ ip-address(){ |
|
|
test -n "$ip" && printf $1 $ip |
|
|
test -n "$ip" && printf $1 $ip |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
__my_ps1_tmux(){ |
|
|
|
|
|
local last=$? |
|
|
|
|
|
if test -n "$TMUX" |
|
|
|
|
|
then |
|
|
|
|
|
echo "[TMUX:$TMUX_PANE]" |
|
|
|
|
|
fi |
|
|
|
|
|
return $last |
|
|
|
|
|
} |
|
|
__my_ps1_moc(){ |
|
|
__my_ps1_moc(){ |
|
|
local last=$? |
|
|
local last=$? |
|
|
__my_moc_state "[MOC:%s]" |
|
|
__my_moc_state "[MOC:%s]" |
|
@@ -461,6 +469,7 @@ __my_ps1_moc(){ |
|
|
} |
|
|
} |
|
|
__my_ps1_git(){ |
|
|
__my_ps1_git(){ |
|
|
local last=$? |
|
|
local last=$? |
|
|
|
|
|
null type __git_ps1 || return $last |
|
|
__try_exec __git_ps1 "[GIT:$(__try_exec git config --get user.name):%s]" |
|
|
__try_exec __git_ps1 "[GIT:$(__try_exec git config --get user.name):%s]" |
|
|
return $last |
|
|
return $last |
|
|
} |
|
|
} |
|
@@ -495,7 +504,7 @@ then |
|
|
__my_cdef="\[\e[0m\]" |
|
|
__my_cdef="\[\e[0m\]" |
|
|
fi |
|
|
fi |
|
|
_PS1="\ |
|
|
_PS1="\ |
|
|
${__my_c4}:: ${__my_cdef}[${__my_c1}\w/${__my_cdef}<${__my_c3}\${OLDPWD}${__my_cdef}]\$(__my_ps1_git)\$(__my_ps1_bttry)\$(__my_ps1_ipaddr)\$(__my_ps1_moc)\n\ |
|
|
|
|
|
|
|
|
${__my_c4}:: ${__my_cdef}[${__my_c1}\w/${__my_cdef}<${__my_c3}\${OLDPWD}${__my_cdef}]\$(__my_ps1_tmux)\$(__my_ps1_git)\$(__my_ps1_bttry)\$(__my_ps1_ipaddr)\$(__my_ps1_moc)\n\ |
|
|
${__my_c4}:: ${__my_c2}\u@\H${__my_cdef} \D{%a, %d %b %Y %T %z} ${SHELL} \V\n\ |
|
|
${__my_c4}:: ${__my_c2}\u@\H${__my_cdef} \D{%a, %d %b %Y %T %z} ${SHELL} \V\n\ |
|
|
${__my_c4}:: ${__my_cdef}shlv:${SHLVL} cnum:\# jobs:\j last:\$? \$ " |
|
|
${__my_c4}:: ${__my_cdef}shlv:${SHLVL} cnum:\# jobs:\j last:\$? \$ " |
|
|
PS1=$_PS1 |
|
|
PS1=$_PS1 |
|
|