.profile: More robust SSH detection

This commit is contained in:
Salt 2020-01-15 20:21:04 +00:00
parent 3f9a4e2827
commit ce338b215c

View File

@ -283,7 +283,7 @@ _ps1bash() {
# Add hostname prefix in SSH sessions
unset prefix
# Alert if in an SSH session
if [ "$SSH_CLIENT" ]; then
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
prefix="${fg_bold}${fg_red}ssh${r}${fg_red}:${r}${prefix}"
fi
# Change PWD color depending on the shell