Skip to content

Commit

Permalink
ssh-agent: fix non-standard process check w/ pgrep
Browse files Browse the repository at this point in the history
Confirmed to work on MacOS, OpenBSD, Solaris and busybox.
  • Loading branch information
mcornella authored and chihchun committed Aug 6, 2019
1 parent 1a1914e commit 46e467a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/ssh-agent/ssh-agent.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [[ $_agent_forwarding == "yes" && -n "$SSH_AUTH_SOCK" ]]; then
elif [[ -f "$_ssh_env_cache" ]]; then
# Source SSH settings, if applicable
. $_ssh_env_cache > /dev/null
ps -o cmd -p $SSH_AGENT_PID | grep -q ssh-agent || {
pgrep ssh-agent | grep -q $SSH_AGENT_PID || {
_start_agent
}
else
Expand Down

0 comments on commit 46e467a

Please sign in to comment.