From 5656ec1fc2b3c8c4a9727f40f9c20b5409745513 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Tue, 26 Mar 2013 10:26:40 -0400 Subject: Fix precmd, prexec in zsh to work with tmux (again) --- .zshrc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.zshrc b/.zshrc index 332d402..7ac7b6a 100644 --- a/.zshrc +++ b/.zshrc @@ -349,16 +349,11 @@ bindkey '\e[6~' down-history # PageDown # This function sets the window tile to user@host:/workingdir before each # prompt. If you're using screen, it sets the window title (works # wonderfully for 'hardstatus' lines. -# Beware: The two functions below have raw control characters. precmd() { # [[ -t 1 ]] || return case $TERM in - *xterm*|rxvt*) print -Pn "]2;%n@%m:%~\a" + *xterm*|rxvt*|screen*) print -Pn "\e]2;%n@%m:%~\a" ;; - # Don't execute if we're in TMUX - screen*) - [[ -n ${TMUX} ]] || print -Pn "\"%n@%m:%~\134" - ;; esac } @@ -366,12 +361,8 @@ precmd() { preexec() { # [[ -t 1 ]] || return case $TERM in - *xterm*|rxvt*) - print -Pn "]2;$1\a" - ;; - screen*) - [[ -n ${TMUX} ]] || print -Pn "\"$1\134" - ;; + *xterm*|rxvt*|screen*) print -Pn "\e]2;$1\a" + ;; esac } -- cgit v1.2.3