summaryrefslogtreecommitdiff
path: root/plugins/ssh-agent
diff options
context:
space:
mode:
authorKozlov Alexander <badryke@gmail.com>2018-11-16 13:38:43 +0300
committerGitHub <noreply@github.com>2018-11-16 13:38:43 +0300
commit8c95c52353118643ac3dbd9b0c185a3129b84bf8 (patch)
treeee7497251b7a541480ae5c6a97b63b14381ed5ee /plugins/ssh-agent
parentdd30cf104c9ca42d89d26a134382ca421869ce7e (diff)
parent3d8f2bda599c8c6d160dc448e5ab28aaf2d5e90d (diff)
downloadzsh-8c95c52353118643ac3dbd9b0c185a3129b84bf8.tar.gz
zsh-8c95c52353118643ac3dbd9b0c185a3129b84bf8.tar.bz2
zsh-8c95c52353118643ac3dbd9b0c185a3129b84bf8.zip
Merge branch 'master' into master
Diffstat (limited to 'plugins/ssh-agent')
-rw-r--r--plugins/ssh-agent/README.md4
-rw-r--r--plugins/ssh-agent/ssh-agent.plugin.zsh7
2 files changed, 9 insertions, 2 deletions
diff --git a/plugins/ssh-agent/README.md b/plugins/ssh-agent/README.md
index 00af42f01..0b96d9bb5 100644
--- a/plugins/ssh-agent/README.md
+++ b/plugins/ssh-agent/README.md
@@ -11,6 +11,8 @@ plugins=(... ssh-agent)
## Instructions
+**IMPORTANT: put these settings _before_ the line that sources oh-my-zsh**
+
To enable **agent forwarding support** add the following to your zshrc file:
```zsh
@@ -33,6 +35,6 @@ zstyle :omz:plugins:ssh-agent lifetime 4h
## Credits
-Based on code from Joseph M. Reagle: http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
+Based on code from Joseph M. Reagle: https://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
Agent-forwarding support based on ideas from Florent Thoumie and Jonas Pfenniger
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