X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/97d1a4836215c13385c1e943ae581abd5c9a345f..bad470a88fc3b9009d1273eaee544685e385c00d:/etc/zsh/.zlogout diff --git a/etc/zsh/.zlogout b/etc/zsh/.zlogout index 8ab31d1..c91a070 100644 --- a/etc/zsh/.zlogout +++ b/etc/zsh/.zlogout @@ -1,12 +1,5 @@ ### cleanup -# XXX: since .zlogout isn't guaranteed to have been run in the same shell as -# our .zprofile was (since we source it in .zshenv for SHLVL=1 among other -# situations) we are not guaranteed to clean up our current session's tmp, -# but it should be cleared out on next session launch _sev_zcleanup -## unset vars that use our tmp since above will remove them -[[ XDG_CACHE_HOME = $_sev_tmp/.xdg.cache ]] && unset XDG_CACHE_DIR -[[ XDG_RUNTIME_DIR = $TMPDIR/.xdg.runtime ]] && unset XDG_RUNTIME_DIR ## clean up any remaining sockets from gpg forwarding [[ -v _GNUPG_SOCK_DEST_BASE ]] && rm -f $_GNUPG_SOCK_DEST_BASE*(=N) @@ -20,20 +13,22 @@ if [[ -o interactive ]] { # - often they are just wrappers for ncurses tput or other tools # - they may not even exist on lightweight systems # - provided scripts/binaries may be buggy or broken - y=0 - for x (rs1 rs2 rs3) { - [[ -v terminfo[$x] ]] || continue - echoti $x - y=1 + y=1 + if [[ -v terminfo ]] { + for x (rs1 rs2 rs3) { + [[ -v terminfo[$x] ]] || continue + echoti $x + y=0 + } } - if (( y == 0 )) { + if { (( y )) && [[ -v termcap ]] } { for x (rs r1 r2 r3) { [[ -v termcap[$x] ]] || continue echotc $x - y=1 + y=0 } } - if (( y == 0 )) { + if (( y )) { # fallback, send ECMA-48 clear echo -en '\e[2J' }