From 30627b531bcf4c8527dd26c6d85962c7adb467b0 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 22 Jun 2023 23:15:17 -0400 Subject: [PATCH] Set ssh auth socket to use gpg-agent --- .zshenv | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.zshenv b/.zshenv index c88f0c6..f4785c2 100644 --- a/.zshenv +++ b/.zshenv @@ -36,3 +36,9 @@ if [[ ! -d "$TMPPREFIX" ]] then mkdir -p "$TMPPREFIX" fi + +# Set SSH auth socket +unset SSH_AGENT_PID +if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" +fi