From 1bb0ee40e2ec38b035a94c382cf15b8ff2e2a65d Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 16 May 2024 13:15:15 -0400 Subject: add gpg-reset-pinentry --- gpg-reset-pinentry | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 gpg-reset-pinentry (limited to 'gpg-reset-pinentry') diff --git a/gpg-reset-pinentry b/gpg-reset-pinentry new file mode 100755 index 0000000..4065d61 --- /dev/null +++ b/gpg-reset-pinentry @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# If I can't use gpg-agent for ssh, then it could be because the pinentry tty is +# locked. This can also happen if I try to sign a commit in emacs, and the +# pinentry minibuffer get eaten by the interface. In both cases, pinentry is +# pending, so I can't unlock the card, but I lost the pinentry and can't enter +# my pin, so I'm totally stuck. Took me forever to figure this out but thanks to +# SultanLegend on StackOverflow I figured it out. +# +# > I had the error when using gpg-agent as my ssh-agent and using a gpg subkey +# > as my ssh key https://wiki.archlinux.org/index.php/GnuPG#gpg-agent. I +# > suspect that the problem was caused by having an invalid pin entry tty for +# > gpg caused by my sleep+lock command used in my sway config +# +# source: https://stackoverflow.com/a/57116258 +gpg-connect-agent updatestartuptty /bye > /dev/null -- cgit v1.2.3