From 2253f9ef9bead0494d3fea83581007c7acd5a357 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 1 Apr 2013 23:24:25 +0200 Subject: [PATCH] zsh/rc: Underline hostname when running on a remote system. Makes it very easy to spot what isn't running on a local machine. --- zsh/rc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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. -- 2.45.2