mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Fix ssh-agent plugin on OS X.
In b2376c3, the `ps` command was changed away from `ps -ef` to
`ps x` (well, `ps -x`, but it was supposed to be `ps x`) because
OpenBSD doesn't support `-ef`. Sadly, OS X doesn't support `ps x`.
This fix adds a switch to use the old flags on OS X, and the newer,
more concise flags on other platforms.
This commit is contained in:
parent
357ab4912b
commit
01a2fd9613
1 changed files with 7 additions and 1 deletions
|
|
@ -57,7 +57,13 @@ if [[ ${_plugin__forwarding} == "yes" && -n "$SSH_AUTH_SOCK" ]]; then
|
|||
elif [ -f "${_plugin__ssh_env}" ]; then
|
||||
# Source SSH settings, if applicable
|
||||
. ${_plugin__ssh_env} > /dev/null
|
||||
ps x | grep ${SSH_AGENT_PID} | grep ssh-agent > /dev/null || {
|
||||
PLATFORM=`uname`
|
||||
if [[ ${PLATFORM} == "Darwin" ]]; then
|
||||
PS_FLAGS="-ef"
|
||||
else
|
||||
PS_FLAGS="x"
|
||||
fi
|
||||
ps ${PS_FLAGS} | grep ${SSH_AGENT_PID} | grep ssh-agent > /dev/null || {
|
||||
_plugin__start_agent;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue