From 06435c8a9f18b894ad9ab9d6363992c50b48314c Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 13 Mar 2010 21:38:21 +0100 Subject: [PATCH] zsh/rc: window_title() optimization, only check TERM on startup. --- zsh/rc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/zsh/rc b/zsh/rc index 74011ab..c0a453e 100644 --- a/zsh/rc +++ b/zsh/rc @@ -326,14 +326,15 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then } # Sets the window title. Works with screen, xterm and rxvt. - window_title() { - if [[ $TERM == screen* ]]; then + if [[ $TERM == screen* ]]; then + window_title() { print -n "\ek$1\e\\" - - elif [[ $TERM == xterm* || $TERM == rxvt* ]]; then + } + elif [[ $TERM == xterm* || $TERM == rxvt* ]]; then + window_title() { print -n "\e]2;$1\e\\" - fi - } + } + fi # Add the preexec() and precmd() hooks. add-zsh-hook preexec window_preexec -- 2.45.2