From d72e9e0e16238ad6f3d090d1073e7aff110c6352 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 6 Dec 2013 12:57:53 +0900 Subject: [PATCH 1/2] fix title settings for remote host --- shrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shrc b/shrc index 5ea9173..bf3e103 100755 --- a/shrc +++ b/shrc @@ -1254,7 +1254,6 @@ __my_set_title(){ case $TERM in (rxvt*|xterm*|aterm|screen*) test -t 1 && - test -n "$DISPLAY" && test -z "$EMACS" && echo -n -e "\033]0;$1\007" ;; @@ -1265,7 +1264,7 @@ if test -n "$TMUX" then __terminal_title="\$(basename \${PWD})" else - __terminal_title"\${USER}@\${HOSTNAME}\:\${PWD}" + __terminal_title="\${USER}@\${HOSTNAME}:\${PWD}" fi if $inzsh then From b71db8dd06d1776a5617e569a3165a9d2eb0de7e Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 6 Dec 2013 13:58:39 +0900 Subject: [PATCH 2/2] fix terminal title --- shrc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/shrc b/shrc index bf3e103..140ffba 100755 --- a/shrc +++ b/shrc @@ -1260,12 +1260,20 @@ __my_set_title(){ esac } -if test -n "$TMUX" -then - __terminal_title="\$(basename \${PWD})" -else - __terminal_title="\${USER}@\${HOSTNAME}:\${PWD}" -fi +case "$TERM" in + screen*) + if test -n "$SSH_CONNECTION" + then + __terminal_title="\${USER}@\${HOSTNAME}:\$(basename \${PWD})" + else + __terminal_title="\$(basename \${PWD})" + fi + ;; + *) + __terminal_title="\${USER}@\${HOSTNAME}:\${PWD}" + ;; +esac + if $inzsh then precmd(){