This function is not necessary. You can check inside the RPROMPT definition with `${SSH_TTY:+"%F{cyan}[%n@%m]%f"}`.