X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=zsh%2Frc;h=c0a453e4b01e026f6e10f4f4e95f567822d8c414;hb=06435c8a9f18b894ad9ab9d6363992c50b48314c;hp=74011ab9c316f8f9a4e42f0e9c627c0341e9d9e2;hpb=1cc9894a039d3089518add8b3d5c9eec8ceeb31c;p=config%2Fdotfiles.git 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