From b368b20deef0d88c618ce3a7cf760b9a61396349 Mon Sep 17 00:00:00 2001 From: druckdev Date: Tue, 15 Jun 2021 13:05:36 +0200 Subject: [PATCH] zsh:zprofile: Only start one ssh-agent per session Also check if ssh-agent is available before launching. --- .config/zsh/.zprofile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index fe6461e..c5bb44f 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -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