From 4f654cce7e4ee8eab56c39a0205a0d84a7f6d2fe Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sat, 27 Apr 2013 16:52:14 -0400 Subject: [PATCH] [Fix #419] Revise running gpg-agent detection --- modules/gpg-agent/init.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/gpg-agent/init.zsh b/modules/gpg-agent/init.zsh index 82bd9a2ec4..cc7eee4ee3 100644 --- a/modules/gpg-agent/init.zsh +++ b/modules/gpg-agent/init.zsh @@ -33,9 +33,10 @@ function _gpg-agent-start { # Source GPG agent settings, if applicable. if [[ -s "${_gpg_env}" ]]; then source "${_gpg_env}" > /dev/null - ps -ef | grep "${SSH_AGENT_PID}" | grep -q 'gpg-agent' || { - _gpg-agent-start - } + ps -U "$USER" -o 'command,pid' \ + | grep "${${(@s.:.)GPG_AGENT_INFO}[2]}" \ + | grep -q '^gpg-agent' \ + || _gpg-agent-start else _gpg-agent-start fi