diff --git a/commands/completion/completion.go b/commands/completion/completion.go index 82476b18227f7ac3dab790367f2f4fca2def0759..958b00479bfbb0afe44afe462c8d26b45039f993 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 400645fc026396f25abb8c439d32eedff200fa82..77ebcd758e95299a30ec33698fcf8a81bb59cc16 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: