]>
Commit | Line | Data |
---|---|---|
1 | ### cleanup | |
2 | _sev_zcleanup | |
3 | ## clean up any remaining sockets from gpg forwarding | |
4 | [[ -v _GNUPG_SOCK_DEST_BASE ]] && rm -f $_GNUPG_SOCK_DEST_BASE*(=N) | |
5 | ||
6 | ## manually reset terminal for interactive logout | |
7 | if [[ -o interactive ]] { | |
8 | # send xterm scrollback clear extension just in case: | |
9 | # - TERM may not be set correctly | |
10 | # - terminfo/termcap database entry for reset may be buggy | |
11 | echo -en '\e[3J' | |
12 | # use terminfo/termcap directly instead of relying on system clear/reset: | |
13 | # - often they are just wrappers for ncurses tput or other tools | |
14 | # - they may not even exist on lightweight systems | |
15 | # - provided scripts/binaries may be buggy or broken | |
16 | y=1 | |
17 | if [[ -v terminfo ]] { | |
18 | for x (rs1 rs2 rs3) { | |
19 | [[ -v terminfo[$x] ]] || continue | |
20 | echoti $x | |
21 | y=0 | |
22 | } | |
23 | } | |
24 | if { (( y )) && [[ -v termcap ]] } { | |
25 | for x (rs r1 r2 r3) { | |
26 | [[ -v termcap[$x] ]] || continue | |
27 | echotc $x | |
28 | y=0 | |
29 | } | |
30 | } | |
31 | if (( y )) { | |
32 | # fallback, send ECMA-48 clear | |
33 | echo -en '\e[2J' | |
34 | } | |
35 | echo logout | |
36 | } | |
37 | ||
38 | ### load site-specific | |
39 | load-site-dotfile zlogout |