aboutsummaryrefslogtreecommitdiffstats
path: root/_zlogout
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-10-20 08:29:44 +0800
committerAaron LI <aly@aaronly.me>2017-10-20 08:29:44 +0800
commit1469b67806d95d026ebc4037bf44f72f0ef170e8 (patch)
treec762b460daf78fab1f136fa11abf9e86db539c9f /_zlogout
parent2b381b69a349eb7cf2b39b5e72595dd5e8ffb8c3 (diff)
downloaddotfiles-1469b67806d95d026ebc4037bf44f72f0ef170e8.tar.bz2
zsh: flush gpg-agent passphrases on logout
Diffstat (limited to '_zlogout')
-rw-r--r--_zlogout11
1 files changed, 9 insertions, 2 deletions
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