zsh:zprofile: Only start one ssh-agent per session

Also check if ssh-agent is available before launching.
This commit is contained in:
2021-06-15 13:05:36 +02:00
parent b0db2b22a1
commit b368b20dee

View File

@@ -46,7 +46,9 @@ fi
[[ ! -e "$XDG_CONFIG_HOME/locale.conf" ]] || . "$XDG_CONFIG_HOME/locale.conf"
# SSH
eval "$(ssh-agent)" >/dev/null
if (( $+commands[ssh-agent] )) && [[ ! $SSH_AGENT_PID ]]; then
eval "$(ssh-agent)" >/dev/null
fi
# Editor
if (( $+commands[nvim] )); then