mksh: color the prompt symbol and hostname label by host
Same host-differentiation as the tmux statusbar: blue accent for prosrvdemadev01, existing yellow/gray colors kept as the default elsewhere. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+8
-2
@@ -56,6 +56,12 @@ und="$(tput smul 2>/dev/null || echo '\e[4m')"
|
|||||||
# Reset
|
# Reset
|
||||||
rst="$(tput sgr 0 2>/dev/null || echo '\e[0m')" # Text Reset
|
rst="$(tput sgr 0 2>/dev/null || echo '\e[0m')" # Text Reset
|
||||||
|
|
||||||
|
# host-specific accent color (default stays as-is; override per host below)
|
||||||
|
case $HOSTNAME in
|
||||||
|
prosrvdemadev01) hostcol="$txtblu"; hostlblcol="$txtblu" ;;
|
||||||
|
*) hostcol="$txtylw"; hostlblcol="$txtgry" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
# rust
|
# rust
|
||||||
export PATH=$PATH:$HOME/.cargo/bin
|
export PATH=$PATH:$HOME/.cargo/bin
|
||||||
# go
|
# go
|
||||||
@@ -191,7 +197,7 @@ PS4='[$EPOCHREALTIME] '; PS1='#'; (( USER_ID )) && PS1='→'; PS1=$'\001\r''${|
|
|||||||
\\builtin typeset e=$?
|
\\builtin typeset e=$?
|
||||||
|
|
||||||
(( e )) && REPLY+="${txtred}$e${txtgry} "
|
(( e )) && REPLY+="${txtred}$e${txtgry} "
|
||||||
{ ( [[ -n $SSH_CLIENT ]] || [[ -n $SSH_TTY ]] ) && [[ -z $TMUX ]] } && REPLY+="${ita}${txtgry}${HOSTNAME} ${rst}"
|
{ ( [[ -n $SSH_CLIENT ]] || [[ -n $SSH_TTY ]] ) && [[ -z $TMUX ]] } && REPLY+="${ita}${hostlblcol}${HOSTNAME} ${rst}"
|
||||||
# REPLY+=${USER}@${HOSTNAME%%.*}:
|
# REPLY+=${USER}@${HOSTNAME%%.*}:
|
||||||
|
|
||||||
\\builtin typeset d=${PWD:-?}/ p=~; [[ $p = ?(*/) ]] || d=${d/#$p\//\~/}
|
\\builtin typeset d=${PWD:-?}/ p=~; [[ $p = ?(*/) ]] || d=${d/#$p\//\~/}
|
||||||
@@ -208,4 +214,4 @@ PS4='[$EPOCHREALTIME] '; PS1='#'; (( USER_ID )) && PS1='→'; PS1=$'\001\r''${|
|
|||||||
print -n "\e]133;A\e\\" # foot sequence for ctrl+shift+x/z
|
print -n "\e]133;A\e\\" # foot sequence for ctrl+shift+x/z
|
||||||
|
|
||||||
\\builtin return $e
|
\\builtin return $e
|
||||||
} '"${txtylw}${bld}$PS1 ${rst}"
|
} '"${hostcol}${bld}$PS1 ${rst}"
|
||||||
|
|||||||
Reference in New Issue
Block a user