From 1469b67806d95d026ebc4037bf44f72f0ef170e8 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 20 Oct 2017 08:29:44 +0800 Subject: zsh: flush gpg-agent passphrases on logout --- _zlogout | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to '_zlogout') diff --git a/_zlogout b/_zlogout index 1db6ba0..52569f3 100644 --- a/_zlogout +++ b/_zlogout @@ -1,9 +1,16 @@ # # ~/.zlogout -# executed when a login zsh shell exits +# Executed when a *login* zsh shell exits # +# Aaron LI +# + +# Flush the cached passphrases on logout, but except for SSH connections +if [[ -z ${SSH_CONNECTION} ]]; then + gpgconf --reload gpg-agent +fi -# clear console +# Clear console if which clear >/dev/null 2>&1; then clear elif which tput >/dev/null 2>&1; then -- cgit v1.2.2