From cccdd724e44fc291a449d689b81ed5d12fb45fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20D=C3=A9trez?= Date: Thu, 27 Nov 2014 04:19:26 +0100 Subject: [PATCH] Add a hook to set the gpg-agent tty --- modules/gpg/init.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/gpg/init.zsh b/modules/gpg/init.zsh index e644b3a2..91dc343f 100644 --- a/modules/gpg/init.zsh +++ b/modules/gpg/init.zsh @@ -35,6 +35,13 @@ if grep 'enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then # Load the SSH module for additional processing. pmodload 'ssh' + + # ssh doesn't set the gpg-agent tty when asking for the key. + # This updates the tty before every command as a workaround + function _gpg-agent-update-tty() { + gpg-connect-agent updatestartuptty /bye > /dev/null + } + add-zsh-hook preexec _gpg-agent-update-tty fi # Clean up.