Open sbushmanov opened 3 years ago
Good catch. I'll try to have a look over the weekend.
Change this:
_trueline_has_ssh() {
if [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_TTY" ]]; then
echo 'has_ssh'
fi
}
to:
_trueline_has_ssh() {
if [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_TTY" ]]; then
echo 'has_ssh'
else
# Source: https://serverfault.com/a/773890
if pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
echo 'has_ssh'
fi
fi
}
When on a remote SSHed session as a user SSH status is displayed properly.
However, when switched to root SSH status disappears.
Would it make sense to keep on displaying SSH status when root as well?