From 631d0c9f8777c10a7f602adaeae202d92bcb2842 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 19 Jan 2009 20:25:21 +0100 Subject: [PATCH] Use a local variable in screen_preexec(). --- zsh/rc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zsh/rc b/zsh/rc index 14c3c16..d283180 100644 --- 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 -- 2.45.2