From 9d82819440799d15053371372c18ae9127b8a8af Mon Sep 17 00:00:00 2001 From: Benjamin Krueger Date: Tue, 4 Feb 2014 22:14:31 -0800 Subject: [PATCH] Fixes #2496: Test for a running ssh-agent at 27385. Much better. --- plugins/gpg-agent/gpg-agent.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/gpg-agent/gpg-agent.plugin.zsh b/plugins/gpg-agent/gpg-agent.plugin.zsh index 3e6a34f42..1f779ad41 100644 --- a/plugins/gpg-agent/gpg-agent.plugin.zsh +++ b/plugins/gpg-agent/gpg-agent.plugin.zsh @@ -26,8 +26,8 @@ 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 + # check for existing ssh-agent + if [[ $(kill -0 $SSH_AGENT_PID) != '0' ]]; then # ssh-agent running, start gpg-agent without ssh support start_agent_nossh; else