Emacs: Check for SSH environment before starting gpg-agent
Alan Pearce alan@alanpearce.uk
Fri, 10 Mar 2017 13:08:29 +0100
1 files changed, 2 insertions(+), 1 deletions(-)
jump to
M tag-emacs/emacs.d/init.org → tag-emacs/emacs.d/init.org
@@ -1289,7 +1289,8 @@ (defun load-private-data () (interactive) (if (not have-private-key) (message "ERROR: Private GPG key not found") - (unless (getenv "GPG_AGENT_INFO") + (unless (or (getenv "GPG_AGENT_INFO") + (getenv "SSH_AUTH_SOCK")) (start-process "gpg-agent" nil "gpg-agent" "--daemon") (setenv "SSH_AUTH_SOCK" gpg-agent-ssh-sock)) (setq password-cache-expiry nil)