}
# 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