only configure ssh agent if not in ssh session

master
Paul Walko 2019-09-09 20:52:41 -04:00
parent c4b599cacf
commit 9eae3e84d5
1 changed files with 7 additions and 5 deletions

12
zshrc
View File

@ -36,12 +36,14 @@ fi
# GPG/SSH # GPG/SSH
## Void: Install pcsclite, pcsc-ccid, gnupg2-scdaemon ## Void: Install pcsclite, pcsc-ccid, gnupg2-scdaemon
## Yubico openpgp: https://support.yubico.com/support/solutions/articles/15000006420-using-your-yubikey-with-openpgp ## Yubico openpgp: https://support.yubico.com/support/solutions/articles/15000006420-using-your-yubikey-with-openpgp
unset SSH_AGENT_PID if [ -z "$SSH_CLIENT" ] || [ -z "$SSH_TTY" ]; then
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then unset SSH_AGENT_PID
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null
fi fi
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null
# VIM # VIM
## Reduce delay swithing between normal & insert mode ## Reduce delay swithing between normal & insert mode