From 4153458445bafa1091beed122745e9531406a6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juh=C3=A1sz=20P=C3=A9ter?= Date: Mon, 21 Oct 2013 22:04:08 +0200 Subject: [PATCH] [screen] -Fix: display host name in screen/tmux window title if remote shell --- git-prompt.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git-prompt.sh b/git-prompt.sh index 820d460..ec4e8ae 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -345,6 +345,11 @@ set_shell_label() { # FIXME: run this only if screen is in xterm (how to test for this?) xterm_label "$full" + # display host name in window title if remote shell + if [[ -n ${SSH_CLIENT} || -n ${SSH2_CLIENT} ]]; then + param="@$host:$param" + fi + printf "\033k%s\033\\" "$param" }