From fc3f8025ea806a20aa0f7a2af9ef6f2be8b3b1a6 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 preexec hook to set the GPG-Agent TTY Signed-off-by: Sorin Ionescu --- modules/gpg/init.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/gpg/init.zsh b/modules/gpg/init.zsh index e644b3a..0ff42d1 100644 --- a/modules/gpg/init.zsh +++ b/modules/gpg/init.zsh @@ -35,6 +35,12 @@ if grep 'enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then # Load the SSH module for additional processing. pmodload 'ssh' + + # Updates the GPG-Agent TTY before every command since SSH does not set it. + function _gpg-agent-update-tty { + gpg-connect-agent UPDATESTARTUPTTY /bye >/dev/null + } + add-zsh-hook preexec _gpg-agent-update-tty fi # Clean up.