]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
zsh: Fix infinite loop with screen on linux console.
authorSimon Ruderich <simon@ruderich.org>
Fri, 13 Mar 2009 17:56:10 +0000 (18:56 +0100)
committerSimon Ruderich <simon@ruderich.org>
Fri, 13 Mar 2009 17:56:10 +0000 (18:56 +0100)
This was caused because screen uses 'screen.linux' instead of 'screen' as
$TERM on a linux console which wasn't checked correctly.

zsh/rc

diff --git a/zsh/rc b/zsh/rc
index 7c59aecf518a4270a7ca51e251b3b7fffa792b83..0618ee40a77548d6c99521a58cbe28cec2a752b5 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -368,7 +368,10 @@ exec 2>>(while read line; do
 # RUN COMMANDS
 
 # If not already in screen reattach to a running session or create a new one.
-if [[ $TERM != 'screen' && $TERM != 'dumb' ]]; then
+#
+# screen* is necessary as `screen` uses screen.linux for example for a linux
+# console which would otherwise cause an infinite loop.
+if [[ $TERM != screen* && $TERM != 'dumb' ]]; then
     # Create a new session if none is running.
     if [[ $(screen -list | grep "Detached" | wc -l) == 0 ]]; then
         screen