]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
zsh/rc: window_title() optimization, only check TERM on startup.
authorSimon Ruderich <simon@ruderich.org>
Sat, 13 Mar 2010 20:38:21 +0000 (21:38 +0100)
committerSimon Ruderich <simon@ruderich.org>
Sat, 13 Mar 2010 20:38:21 +0000 (21:38 +0100)
zsh/rc

diff --git a/zsh/rc b/zsh/rc
index 74011ab9c316f8f9a4e42f0e9c627c0341e9d9e2..c0a453e4b01e026f6e10f4f4e95f567822d8c414 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -326,14 +326,15 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then
     }
 
     # Sets the window title. Works with screen, xterm and rxvt.
-    window_title() {
-        if [[ $TERM == screen* ]]; then
+    if [[ $TERM == screen* ]]; then
+        window_title() {
             print -n "\ek$1\e\\"
-
-        elif [[ $TERM == xterm* || $TERM == rxvt* ]]; then
+        }
+    elif [[ $TERM == xterm* || $TERM == rxvt* ]]; then
+        window_title() {
             print -n "\e]2;$1\e\\"
-        fi
-    }
+        }
+    fi
 
     # Add the preexec() and precmd() hooks.
     add-zsh-hook preexec window_preexec