]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
zsh/rc: Prevent error when running on a different TERM.
authorSimon Ruderich <simon@ruderich.org>
Mon, 21 Jun 2010 12:54:03 +0000 (14:54 +0200)
committerSimon Ruderich <simon@ruderich.org>
Mon, 21 Jun 2010 12:54:03 +0000 (14:54 +0200)
This happened because window_preexec() is only defined if TERM is
screen*, xterm* or rxvt*. On other TERMs the call to window_preexec() in
"RUN COMMANDS" failed.

zsh/rc

diff --git a/zsh/rc b/zsh/rc
index b0da57812b5033f6511e5314cdf08e80dd9161d8..5e97beaab4604277f660124c9c5499c3e5e50689 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -428,6 +428,10 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then
     # Add the preexec() and precmd() hooks.
     add-zsh-hook preexec window_preexec
     add-zsh-hook precmd window_precmd
+else
+    # Fallback if another TERM is used, necessary to run screen (see below in
+    # "RUN COMMANDS").
+    window_preexec() { }
 fi