]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
Use a local variable in screen_preexec().
authorSimon Ruderich <simon@ruderich.org>
Mon, 19 Jan 2009 19:25:21 +0000 (20:25 +0100)
committerSimon Ruderich <simon@ruderich.org>
Mon, 16 Feb 2009 15:34:41 +0000 (16:34 +0100)
zsh/rc

diff --git a/zsh/rc b/zsh/rc
index 14c3c1660ff386d092cdd0a140794db451eb66c2..d283180ee40fa28812f241aaf1e55a25065e7cae 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -102,13 +102,16 @@ if [[ $TERM == screen ]]; then
     screen_name_reset=yes
 
     screen_preexec() {
+        # Get the application name excluding any arguments.
+        local program_name=${1%% *}
+
         # Ignore often used commands which are only running for a very short
         # time. This prevents a "blinking" name when it's changed to "cd" for
         # example and then some milliseconds later back to "zsh".
-        [[ ${1%% *} == (cd*|ls|la|ll|clear) ]] && return
+        [[ $program_name == (cd*|ls|la|ll|clear) ]] && return
 
         # Set the window name to the currently running program.
-        print -n "\ek${1%% *}\e\\"
+        print -n "\ek$program_name\e\\"
 
         # Tell precmd() to reset the window name when the program stops.
         screen_name_reset=yes