973a4e646c09b69e7d491d530826778f0d9d7e49
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
ssh-agent: fix non-standard process check w/ pgrep
Confirmed to work on MacOS, OpenBSD, Solaris and busybox.
Diff
1diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
2index a84aac58ca337d4ecae06928d1b31cb5195ce01c..b668fa3b240e3a68a769f6cd6503abc82afe63fd 100644
3--- a/plugins/ssh-agent/ssh-agent.plugin.zsh
4+++ b/plugins/ssh-agent/ssh-agent.plugin.zsh
5@@ -30,7 +30,7 @@ if [[ $_agent_forwarding == "yes" && -n "$SSH_AUTH_SOCK" ]]; then
6 elif [[ -f "$_ssh_env_cache" ]]; then
7 # Source SSH settings, if applicable
8 . $_ssh_env_cache > /dev/null
9- ps -o cmd -p $SSH_AGENT_PID | grep -q ssh-agent || {
10+ pgrep ssh-agent | grep -q $SSH_AGENT_PID || {
11 _start_agent
12 }
13 else