浏览代码

Simplify PID check of current ssh-agent

Marc Cornellà 8 年之前
父节点
当前提交
142ad842d7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugins/ssh-agent/ssh-agent.plugin.zsh

+ 1 - 1
plugins/ssh-agent/ssh-agent.plugin.zsh

@@ -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 x | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null || {
+	ps -o cmd -p $SSH_AGENT_PID | grep -q ssh-agent || {
 		_start_agent
 	}
 else