From 329486c335e0b0f35b91ba3529d7319de96b5167 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 5 Aug 2026 11:52:15 +0200 Subject: [PATCH] fix: load agents from zstyle Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- plugins/keychain/keychain.plugin.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index d655e1722..f1ca0d934 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -29,12 +29,17 @@ function { # Keychain 3.x: subcommand-based CLI, no --agents. keychain add ${^options:-} --host $SHORT_HOST ${^identities} else + local agents + + # load agents to start (only used by keychain < 2.9). + zstyle -s :omz:plugins:keychain agents agents + autoload -Uz is-at-least if [[ "${version_string:l}" =~ 'keychain ([0-9]+\.[0-9]+)' ]] && \ is-at-least 2.9 "$match[1]"; then keychain ${^options:-} ${^identities} --host $SHORT_HOST else - keychain ${^options:-} --agents ${agents:-ssh} ${^identities} --host $SHORT_HOST + keychain ${^options:-} --agents ${agents:-gpg} ${^identities} --host $SHORT_HOST fi fi