Skip to content

Commit 20e6cf0

Browse files
unixornseanb4t
authored andcommitted
Add an option to _not_ load ssh keys
Make it easy to make the quickstart not attempt to load `ssh` keys. This makes it easier for someone to store their `ssh` private keys in a yubikey. Closes unixorn#267 Signed-off-by: Joe Block <[email protected]>
1 parent 947c2e4 commit 20e6cf0

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

zsh/.zshrc

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,10 @@ if [[ -z "$SSH_CLIENT" ]] || can_haz keychain; then
378378
if [[ "$(_zqs-get-setting ssh-askpass-require)" == 'true' ]]; then
379379
zsh-quickstart-set-ssh-askpass-require
380380
fi
381-
load-our-ssh-keys
381+
load_ssh_keys="$(_zqs-get-setting load-ssh-keys true)"
382+
if [[ "$load_ssh_keys" != "false" ]]; then
383+
load-our-ssh-keys
384+
fi
382385
fi
383386

384387
# Load local env settings ( if they exist )
@@ -758,17 +761,19 @@ function zqs-help() {
758761
echo ""
759762
echo "Quickstart settings commands:"
760763
echo "zqs disable-bindkey-handling - Set the quickstart to not touch any bindkey settings. Useful if you're using another plugin to handle it."
761-
echo "zqs enable-bindkey-handling - Set the quickstart to configure your bindkey settings. Default behavior."
764+
echo "zqs enable-bindkey-handling - Set the quickstart to configure your bindkey settings. This is the default behavior."
762765
echo "zqs enable-control-c-decorator - Creates a TRAPINT function to display '^C' when you type control-c instead of being silent. Default behavior."
763766
echo "zqs disable-control-c-decorator - No longer creates a TRAPINT function to display '^C' when you type control-c."
764767
echo "zqs disable-omz-plugins - Set the quickstart to not load oh-my-zsh plugins if you're using the standard plugin list"
765768
echo "zqs enable-omz-plugins - Set the quickstart to load oh-my-zsh plugins if you're using the standard plugin list"
766769
echo "zqs enable-ssh-askpass-require - Set the quickstart to prompt for your ssh passphrase on the command line."
767-
echo "zqs disable-ssh-askpass-require - Set the quickstart to prompt for your ssh passphrase via a gui program. Default behavior"
770+
echo "zqs disable-ssh-askpass-require - Set the quickstart to prompt for your ssh passphrase via a gui program. This is the default behavior"
768771
echo "zqs disable-ssh-key-listing - Set the quickstart to not display all the loaded ssh keys"
769-
echo "zqs enable-ssh-key-listing - Set the quickstart to display all the loaded ssh keys. Default behavior."
772+
echo "zqs enable-ssh-key-listing - Set the quickstart to display all the loaded ssh keys. This is the default behavior."
773+
echo "zqs disable-ssh-key-loading - Set the quickstart to not load your ssh keys. Useful if you're storing them in a yubikey."
774+
echo "zqs enable-ssh-key-loading - Set the quickstart to load your ssh keys if they aren't already in an ssh agent. This is the default behavior."
770775
echo "zqs disable-zmv-autoloading - Set the quickstart to not run 'autoload -U zmv'. Useful if you're using another plugin to handle it."
771-
echo "zqs enable-zmv-autoloading - Set the quickstart to run 'autoload -U zmv'. Default behavior."
776+
echo "zqs enable-zmv-autoloading - Set the quickstart to run 'autoload -U zmv'. This is the default behavior."
772777
echo "zqs delete-setting SETTINGNAME - Remove a zqs setting file"
773778
echo "zqs get-setting SETTINGNAME [optional default value] - load a zqs setting"
774779
echo "zqs set-setting SETTINGNAME value - Set an arbitrary zqs setting"
@@ -816,6 +821,12 @@ function zqs() {
816821
'disable-ssh-key-listing')
817822
_zqs-set-setting list-ssh-keys false
818823
;;
824+
'disable-ssh-key-loading')
825+
_zqs-set-setting load-ssh-keys false
826+
;;
827+
'enable-ssh-key-loading')
828+
_zqs-set-setting load-ssh-keys true
829+
;;
819830
'selfupdate')
820831
_update-zsh-quickstart
821832
;;

0 commit comments

Comments
 (0)