142ad842d706e16317bcc8b44ef1b19d625d1fb8

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Simplify PID check of current ssh-agent

Diff

 1diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
 2index a427b80aefa2219292967df3f7a23cff0b029cdd..e6bc9c4e682a79b810f7c807905eea75b0c03545 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 x | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null || {
10+	ps -o cmd -p $SSH_AGENT_PID | grep -q ssh-agent || {
11 		_start_agent
12 	}
13 else