From b4f9698733d7b29cc495e649e26fd6c3a5dcfcae Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Tue, 11 Apr 2023 01:41:00 -0700 Subject: docs(ssh-agent): macOS and p10k advices (#11612) --- plugins/ssh-agent/README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'plugins/ssh-agent') diff --git a/plugins/ssh-agent/README.md b/plugins/ssh-agent/README.md index fa6a996d4..8c118e65b 100644 --- a/plugins/ssh-agent/README.md +++ b/plugins/ssh-agent/README.md @@ -99,6 +99,33 @@ ssh-add -K -c -a /run/user/1000/ssh-auth For valid `ssh-add` arguments run `ssh-add --help` or `man ssh-add`. +### Powerline 10k specific settings + +Powerline10k has an instant prompt setting that doesn't like when this plugin +writes to the console. Consider using the following settings if you're using +p10k (documented above): + +``` +zstyle :omz:plugins:ssh-agent quiet yes +zstyle :omz:plugins:ssh-agent lazy yes +``` + +### macOS specific settings + +macOS supports using passphrases stored in the keychain when adding identities +to the ssh-agent. + +``` +ssh-add --apple-use-keychain ~/.ssh/id_rsa ... +``` + + +This plugin can be configured to use the keychain when loading using the following: + +``` +zstyle :omz:plugins:ssh-agent ssh-add-args --apple-load-keychain +``` + ## Credits Based on code from Joseph M. Reagle: https://www.cygwin.com/ml/cygwin/2001-06/msg00537.html -- cgit v1.2.3-70-g09d2 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: 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(+) (limited to 'plugins/ssh-agent') 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 -- cgit v1.2.3-70-g09d2