diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index 6bf237c..fca663a 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -27,7 +27,7 @@ if [[ ! -S "$SSH_AUTH_SOCK" ]]; then # Start ssh-agent if not started. if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${SSH_AGENT_PID:--1} ssh-agent"; then mkdir -p "$_ssh_agent_env:h" - eval "$(ssh-agent | sed '/^echo /d' | tee "$_ssh_agent_env")" + eval "$(print -l "${(@)${(f)"$(ssh-agent)"}:#echo *}" | tee "$_ssh_agent_env")" fi fi @@ -39,7 +39,7 @@ if [[ -S "$SSH_AUTH_SOCK" && "$SSH_AUTH_SOCK" != "$_ssh_agent_sock" ]]; then fi # Load identities. -if ssh-add -l 2>&1 | grep -q 'The agent has no identities'; then +if [[ ${(@M)${(f)"$(ssh-add -l 2>&1)"}:#The agent has no identities*} ]]; then zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities' # ssh-add has strange requirements for running SSH_ASKPASS, so we duplicate # them here. Essentially, if the other requirements are met, we redirect stdin