[Pkg-zsh-devel] Bug#794968: zsh: please clear console on logout (if recommended config is used)
Carsten Hey
carsten at debian.org
Mon Aug 10 21:25:10 UTC 2015
* Carsten Hey [2015-08-09 18:05 +0200]:
> Pasting the code that would be part of the recommended .zlogout could
> help to clarify some things, but there's still a GPL'd triviality in it.
Without the GPL'd trivial check of being a subshell - i.e., this test
needs to be added before it can be shipped, a ~/.zlogout could look like
this:
if [[ -z ${SSH_CONNECTION-}${TMUX-}${debian_chroot-} ]] &&
[[ ${0##*/} != (-su|su) && -x /usr/bin/clear_console ]]
then
/usr/bin/clear_console || :
fi
The first line is mainly used to avoid accessing the hard disk and
spawning a new process in some common cases - only the check for an
empty ${debian_chroot-} might be required, depending on the actual
implementation of schroot et al.
Also using [[ ${TTY-} != /dev/pts/* ]] would avoid running clear_console
in other cases and possibly make checking ${SSH_CONNECTION-} and
${TMUX-} obsolete.
Carsten
More information about the Pkg-zsh-devel
mailing list