]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
zsh/rc: Fix window_precmd() when running zsh as root through ssh.
authorSimon Ruderich <simon@ruderich.org>
Tue, 30 Mar 2010 22:49:32 +0000 (00:49 +0200)
committerSimon Ruderich <simon@ruderich.org>
Tue, 30 Mar 2010 22:49:32 +0000 (00:49 +0200)
zsh/rc

diff --git a/zsh/rc b/zsh/rc
index 7ccbe91e1766df634eedaf45b1a5a50c058cb1d3..ef32525f23f4c19cb147d40a9a70006c1ed6e340 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -326,13 +326,13 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then
         fi
 
         # Prepend prefixes like in window_preexec().
+        if [[ -n $window_root ]]; then
+            name="!$name"
+        fi
         if [[ -n $SSH_CONNECTION ]]; then
-            window_title "@$name"
-        elif [[ -n $window_root ]]; then
-            window_title "!$name"
-        else
-            window_title $name
+            name="@$name"
         fi
+        window_title $name
 
         # Just reset the name, so no screen reset necessary for the moment.
         window_reset=