summaryrefslogtreecommitdiff
path: root/plugins/ssh-agent/ssh-agent.plugin.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2018-07-11 10:39:25 -0700
committerTuowen Zhao <ztuowen@gmail.com>2018-07-11 10:39:25 -0700
commit852e7fe005267f74f3c04a4ddbb310522eee8014 (patch)
tree73e9f36d8bdcc979d7499580505738074e5a1dc9 /plugins/ssh-agent/ssh-agent.plugin.zsh
parent59e91cd97fcc3c406751f019215f957b36614022 (diff)
parent7cb5fa8aea3d325fee08e3c1708abd12cdea1c1c (diff)
downloadzsh-852e7fe005267f74f3c04a4ddbb310522eee8014.tar.gz
zsh-852e7fe005267f74f3c04a4ddbb310522eee8014.tar.bz2
zsh-852e7fe005267f74f3c04a4ddbb310522eee8014.zip
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/ssh-agent/ssh-agent.plugin.zsh')
-rw-r--r--plugins/ssh-agent/ssh-agent.plugin.zsh7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
index 20f97c6f1..fe4946c6d 100644
--- a/plugins/ssh-agent/ssh-agent.plugin.zsh
+++ b/plugins/ssh-agent/ssh-agent.plugin.zsh
@@ -30,7 +30,12 @@ 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 | grep -q $SSH_AGENT_PID || {
+ if [[ $USER == "root" ]]; then
+ FILTER="ax"
+ else
+ FILTER="x"
+ fi
+ ps $FILTER | grep ssh-agent | grep -q $SSH_AGENT_PID || {
_start_agent
}
else