From: Frank Terbeck Date: Tue, 24 Feb 2009 19:42:57 +0000 (+0100) Subject: Add support $NOTITLE variable X-Git-Tag: v0.3.65~13 X-Git-Url: https://git.grml.org/?a=commitdiff_plain;ds=sidebyside;h=987bb60144a0483dbb42fb2bf3358bc3edaa0782;p=grml-etc-core.git Add support $NOTITLE variable 'NOTITLE=1 zsh' allows the user to disable the alteration of terminal titles without completely disabling the precmd() and preexec() functions (in contrast to the already existing $NOPRECMD variable, which achieves a similar result by doing exactly that). --- diff --git a/debian/changelog b/debian/changelog index 9739df2..a343624 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-etc-core (0.3.65) unstable; urgency=low + + * zshrc: Add $NOTITLE to disable alteration of terminal titles. + Based on an idea by Timo Boettcher. + + -- Frank Terbeck Tue, 24 Feb 2009 20:44:29 +0100 + grml-etc-core (0.3.64) unstable; urgency=low * zshrc: rewrite of zurl() by Alexander Steinböck [Closes: issue627] diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index cb911c1..cf22e1c 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -1961,6 +1961,8 @@ setopt prompt_subst # make sure to use right prompt only when not running a command is41 && setopt transient_rprompt +# TODO: revise all these NO* variables and especially their documentation +# in zsh-help() below. is4 && [[ $NOPRECMD -eq 0 ]] && precmd () { [[ $NOPRECMD -gt 0 ]] && return 0 # update VCS information @@ -1985,6 +1987,7 @@ is4 && [[ $NOPRECMD -eq 0 ]] && precmd () { fi # adjust title of xterm # see http://www.faqs.org/docs/Linux-mini/Xterm-Title.html + [[ NOTITLE -gt 0 ]] && return 0 case $TERM in (xterm*|rxvt*) print -Pn "\e]0;%n@%m: %~\a" @@ -2008,6 +2011,7 @@ preexec () { echo -ne "\ek$CMD\e\\" fi # adjust title of xterm + [[ NOTITLE -gt 0 ]] && return 0 case $TERM in (xterm*|rxvt) print -Pn "\e]0;%n@%m: $1\a" @@ -2230,6 +2234,8 @@ the zsh yet. :) "NOCOR=1 zsh" => deactivate automatic correction "NOMENU=1 zsh" => do not use auto menu completion (note: use ctrl-d for completion instead!) "NOPRECMD=1 zsh" => disable the precmd + preexec commands (set GNU screen title) + "NOTITLE=1 zsh" => disable setting the title of xterms without disabling + preexec() and precmd() completely "BATTERY=1 zsh" => activate battery status (via acpi) on right side of prompt A value greater than 0 is enables a feature; a value equal to zero