From de1caf66a265f6d52c799f4d8afc283d01e0517a Mon Sep 17 00:00:00 2001 From: Jay McCure Date: Mon, 19 Dec 2022 16:03:14 +1000 Subject: [PATCH] docs(completion): instructions for zsh 1password completions --- commands/completion/completion.go | 10 +++++++++- docs/source/completion/index.md | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/commands/completion/completion.go b/commands/completion/completion.go index 82476b182..958b00479 100644 --- a/commands/completion/completion.go +++ b/commands/completion/completion.go @@ -58,7 +58,15 @@ func NewCmdCompletion(io *iostreams.IOStreams) *cobra.Command { To load completions in your current shell session: %[2]splaintext - source "$(glab completion -s zsh); compdef _glab glab + source <(glab completion -s zsh); compdef _glab glab + %[2]s + + If using the 1Password shell plugin + to authenticate, you may need to add the following to your ~/.zshrc file so zsh does not expand + aliases before performing completion: + + %[2]splaintext + setopt completealiases %[2]s To load completions for every new session, execute once: diff --git a/docs/source/completion/index.md b/docs/source/completion/index.md index 400645fc0..77ebcd758 100755 --- a/docs/source/completion/index.md +++ b/docs/source/completion/index.md @@ -52,7 +52,15 @@ echo "autoload -U compinit; compinit" >> ~/.zshrc To load completions in your current shell session: ```plaintext -source "$(glab completion -s zsh); compdef _glab glab +source <(glab completion -s zsh); compdef _glab glab +``` + +If using the 1Password shell plugin +to authenticate, you may need to add the following to your ~/.zshrc file so zsh does not expand +aliases before performing completion: + +```plaintext +setopt completealiases ``` To load completions for every new session, execute once: -- GitLab