From: Simon Ruderich Date: Mon, 1 Apr 2013 21:24:25 +0000 (+0200) Subject: zsh/rc: Underline hostname when running on a remote system. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=2253f9ef9bead0494d3fea83581007c7acd5a357;p=config%2Fdotfiles.git zsh/rc: Underline hostname when running on a remote system. Makes it very easy to spot what isn't running on a local machine. --- diff --git a/zsh/rc b/zsh/rc index 8fb5367..5889186 100644 --- a/zsh/rc +++ b/zsh/rc @@ -375,8 +375,13 @@ prompt_precmd() { # User name (%n) in bright green. local user="${green}%B%n%b${default}" - # Host name (%m) in bright green. + # Host name (%m) in bright green; underlined if running on a remote system + # through SSH. local host="${green}%B%m%b${default}" + if [[ -n $SSH_CONNECTION ]]; then + host="%U${host}%u" + fi + # Number of background processes in yellow. local background="%(1j.${yellow}%j${default}.)" # Exit code in bright red if not zero.