.profile: Clean up, make ssh sessions simpler

This commit is contained in:
Salt 2020-01-15 20:13:44 +00:00
parent a45e2fe4a6
commit 3f9a4e2827

View File

@ -282,24 +282,16 @@ _ps1bash() {
# Add hostname prefix in SSH sessions
unset prefix
# Yes, shellcheck. I get it. That's what the or is for
#shellcheck disable=2039
if [ "$HOSTNAME" = "phys-saltshaker" ] || [ "$(hostname)" = "phys-saltshaker" ]; then
prefix="${fg_bold}${fg_grey}ss${r}${fg_grey}:${r}"
fi
# Alert if in an SSH session
if [ "$SSH_CLIENT" ]; then
prefix="${fg_bold}${fg_red}$(hostname)${r}${fg_red}:${r}${prefix}"
fi
# Append "vim" in Vim
if [ -n "$VIM_TERMINAL" ]; then
prefix="${fg_bold}${fg_green}*${r}"
prefix="${fg_bold}${fg_red}ssh${r}${fg_red}:${r}${prefix}"
fi
# Change PWD color depending on the shell
case $0 in
*bash)
prefix="${prefix}${fg_blue}"
;;
/bin/ksh)
*ksh)
prefix="${prefix}${fg_green}"
;;
*)