X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=plugins%2Fssh_macos%2Fssh_macos.zprofile;h=ac40ecb3ee1fe885cdb0e9aee812ea89d38596ae;hb=HEAD;hp=27e3450e5a31f7ec0ca090b6b133be317667d063;hpb=949bcb8f0d40218508f2844165b63c6df08cba78;p=ax-zsh.git diff --git a/plugins/ssh_macos/ssh_macos.zprofile b/plugins/ssh_macos/ssh_macos.zprofile index 27e3450..ac40ecb 100644 --- a/plugins/ssh_macos/ssh_macos.zprofile +++ b/plugins/ssh_macos/ssh_macos.zprofile @@ -8,6 +8,9 @@ [[ $(uname -s) = "Darwin" ]] || return 1 [[ $(uname -r | cut -d'.' -f1) -ge 16 ]] || return 1 +# Make sure that an SSH agent is available (but ignore failure): +[[ -n "$SSH_AUTH_SOCK" ]] || return 0 + # Start a backgroud job that tries to load the SSH keys from Keychain into # the SSH agent, when the agent has no keys. ssh-add -l >/dev/null || ssh-add -A >/dev/null 2>&1 &!