]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - zsh/rc
zsh/rc: Prevent error when running on a different TERM.
[config/dotfiles.git] / zsh / rc
diff --git a/zsh/rc b/zsh/rc
index 4620ef4ac62e6fc378426cac382598af970ad5b8..5e97beaab4604277f660124c9c5499c3e5e50689 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -373,7 +373,7 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then
             # in the term/outer screen.
             if [[ $program_name == @screen ]]; then
                 program_name="@:${$(hostname)//.*/}"
-            # Use "@:!hostname" for root commands.
+            # Use "@:!hostname" for root screens.
             elif [[ $program_name == @!screen ]]; then
                 program_name="@:!${$(hostname)//.*/}"
             fi
@@ -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