From 87f7098dd470ffbf480eb65f6f4d343babaf9d08 Mon Sep 17 00:00:00 2001 From: Benjamin Krueger Date: Wed, 22 Jan 2014 17:40:46 -0800 Subject: [PATCH] Improved ssh-agent check The old test does not work if an ssh-agent is running but has no identities loaded. This works and is much cleaner. --- plugins/gpg-agent/gpg-agent.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gpg-agent/gpg-agent.plugin.zsh b/plugins/gpg-agent/gpg-agent.plugin.zsh index 3e6a34f42..50d3a1456 100644 --- a/plugins/gpg-agent/gpg-agent.plugin.zsh +++ b/plugins/gpg-agent/gpg-agent.plugin.zsh @@ -27,7 +27,7 @@ if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then # check again if another agent is running using the newly sourced settings if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then # check for existing ssh-agent - if ssh-add -l > /dev/null 2> /dev/null; then + if [[ -n $SSH_AUTH_SOCK ]]; then # ssh-agent running, start gpg-agent without ssh support start_agent_nossh; else