1
1
Fork 0

beatific: highlight hostname of SSH sessions

This commit is contained in:
Jaculabilis 2024-02-05 18:12:12 +00:00
parent c74cb1d16d
commit fbf96fd83a
1 changed files with 7 additions and 3 deletions

View File

@ -17,12 +17,16 @@ _pwd () {
} }
_DIR='$(_pwd)' _DIR='$(_pwd)'
# Color codes # Color codes
_GREEN="\[\033[1;32m\]" _GREEN="\[\033[32;1m\]"
_DIM="\[\e[92;2m\]" _DIM="\[\e[32;2m\]"
_OLIVE="\[\e[33;2m\]"
_RESET="\[\e[0m\]" _RESET="\[\e[0m\]"
_HOST=$(if [ -z "$SSH_CLIENT" ]; then echo $_DIM; else echo $_OLIVE; fi)
# Nested shell level # Nested shell level
_SHLVL=$(printf '\$%.0s' $(seq 1 $SHLVL)) _SHLVL=$(printf '\$%.0s' $(seq 1 $SHLVL))
# SSH detection
_SSH='$([ ! -z "$SSH_CLIENT" ] && echo "=>")'
# Build prompt # Build prompt
export PS1="$_SET_TITLE_BAR$_DIM[\A \u@\h:$_RESET$_GREEN$_DIR$_RESET$_DIM]$_SHLVL$_RESET " export PS1="$_SET_TITLE_BAR$_DIM[\A \u@$_RESET$_HOST\h$_DIM:$_RESET$_GREEN$_DIR$_RESET$_DIM]$_SHLVL$_RESET "
export HISTCONTROL=ignoreboth export HISTCONTROL=ignoreboth