Update how we set SSH_AUTH_SOCK.

This commit is contained in:
David Tomaschik
2020-05-31 13:41:28 -07:00
parent 7f9a3774ae
commit ee83a40686

View File

@@ -20,13 +20,19 @@ fi
# Inform gpg-agent of the current TTY for user prompts.
export GPG_TTY="$(tty)"
# Integrate with the SSH module.
# Setup SSH agent support
if grep '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then
# Load required functions.
autoload -Uz add-zsh-hook
# Override the ssh-agent environment file default path.
_ssh_agent_env="$_gpg_agent_env"
if test -z "$SSH_AUTH_SOCK" ; then
SSH_AUTH_SOCK="/run/user/$(id -u)/gnupg/S.gpg-agent.ssh"
if test -S "$SSH_AUTH_SOCK" ; then
export SSH_AUTH_SOCK
else
unset SSH_AUTH_SOCK
fi
fi
# Updates the GPG-Agent TTY before every command since SSH does not set it.
function _gpg-agent-update-tty {