Skip to content

Commit

Permalink
[Fix #419] Revise running gpg-agent detection
Browse files Browse the repository at this point in the history
  • Loading branch information
sorin-ionescu committed Apr 27, 2013
1 parent b42479a commit 4f654cc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/gpg-agent/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4f654cc

Please sign in to comment.