From 5a72d7c31f72c99c984964e65ec6d2471098d996 Mon Sep 17 00:00:00 2001 From: Philipp A Date: Wed, 4 Oct 2017 20:24:05 +0200 Subject: [PATCH] use SSH_ASKPASS variable. fixes #1478 --- modules/ssh/init.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index c0316d24..9be89d75 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -39,11 +39,12 @@ fi # Load identities. if ssh-add -l 2>&1 | grep -q 'The agent has no identities'; then zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities' + _identities=("${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}}") # Check for Linux system and ssh-askpass presence - if [[ "$OSTYPE" == linux* ]] && [[ ! -a /usr/lib/ssh/x11-ssh-askpass ]]; then - ssh-add "${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}}" 2> /dev/null + if [[ "$OSTYPE" == linux* && ! -x "$SSH_ASKPASS" ]]; then + ssh-add "${_identities[@]}" 2> /dev/null else - ssh-add "${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}}" < /dev/null 2> /dev/null + ssh-add "${_identities[@]}" < /dev/null 2> /dev/null fi fi