]>
Commit | Line | Data |
---|---|---|
6d54344e | 1 | ### cleanup |
6d54344e | 2 | _sev_zcleanup |
6d54344e | 3 | ## clean up any remaining sockets from gpg forwarding |
e69caf64 | 4 | [[ -v _GNUPG_SOCK_DEST_BASE ]] && rm -f $_GNUPG_SOCK_DEST_BASE*(=N) |
79d4a356 | 5 | |
b484bab8 | 6 | ## manually reset terminal for interactive logout |
833b2af3 | 7 | if [[ -o interactive ]] { |
b484bab8 | 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 | |
294ed44e | 11 | echo -en '\e[3J' |
b484bab8 | 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 | |
b8a33b95 | 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 | } | |
b484bab8 | 23 | } |
3035eb5a | 24 | if { (( y )) && [[ -v termcap ]] } { |
b484bab8 | 25 | for x (rs r1 r2 r3) { |
26 | [[ -v termcap[$x] ]] || continue | |
27 | echotc $x | |
b8a33b95 | 28 | y=0 |
b484bab8 | 29 | } |
30 | } | |
b8a33b95 | 31 | if (( y )) { |
b484bab8 | 32 | # fallback, send ECMA-48 clear |
294ed44e | 33 | echo -en '\e[2J' |
b484bab8 | 34 | } |
833b2af3 | 35 | echo logout |
833b2af3 | 36 | } |
8eb81f95 | 37 | |
38 | ### load site-specific | |
4ced48ed | 39 | load-site-dotfile zlogout |