From 33c8ade6c9c7b76523d06610735406df88da665f Mon Sep 17 00:00:00 2001 From: gotyaoi Date: Mon, 16 Feb 2015 10:35:03 -0800 Subject: [PATCH] Update lib/termsupport.zsh to account for tmux Since the default and recommended config for tmux sets TERM to screen or screen-256color, this file was attempting to set tmux's title using screen hardstatus. While tmux can be configured to accept these codes, it makes more sense to simply set the window name normally, so tmux can get the title from the active pane. This commit avoids using screen hardstatus when tmux is detected, and instead uses normal window codes. --- lib/termsupport.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index e1c2e2f93..975788701 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -13,9 +13,9 @@ function title { # if it is set and empty, leave it as is : ${2=$1} - if [[ "$TERM" == screen* ]]; then + if [[ "$TERM" == screen* ]] && [[ -z $TMUX ]]; then print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars - elif [[ "$TERM" == xterm* ]] || [[ "$TERM" == rxvt* ]] || [[ "$TERM" == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then + elif [[ "$TERM" == xterm* ]] || [[ "$TERM" == rxvt* ]] || [[ "$TERM" == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]] || [[ -n $TMUX ]]; then print -Pn "\e]2;$2:q\a" #set window name print -Pn "\e]1;$1:q\a" #set icon (=tab) name fi