From 0da416986aadbaf89dc5596b01f9b42403f4d9fd Mon Sep 17 00:00:00 2001 From: Vishal Sharma <106011641+vishal-sharma-369@users.noreply.github.com> Date: Wed, 18 Oct 2023 23:44:47 +0530 Subject: [PATCH] fix(ssh-agent): add error message if `~/.ssh` is not found (#11929) Closes #11829 Co-authored-by: Carlo Sala --- plugins/ssh-agent/ssh-agent.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 78ac46b13..49ad95a11 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -13,6 +13,11 @@ function _start_agent() { fi fi + if [[ ! -d "$HOME/.ssh" ]]; then + echo "[oh-my-zsh] ssh-agent plugin requires ~/.ssh directory" + return 1 + fi + # Set a maximum lifetime for identities added to ssh-agent local lifetime zstyle -s :omz:plugins:ssh-agent lifetime lifetime