You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first line in the chezmoi zsh completion is currently (and incorrectly):
#compdef _chezmoi chezmoi
ZSH interprets that as the file containing completion for chezmoi as well as _chezmoi. However, _chezmoi is the completion function itself, and should not be completed by itself (it shouldn't be completed at all).
When experimenting trying to tab complete arguments to _chezmoi results in zsh hanging (so something is really broken there, probably that to the line requestComp="${words[1]} __complete ${words[2,-1]}" results in a recursive call to _chezmoi).
The fix is easy though, change the first line to:
#compdef chezmoi
To reproduce
Try to tab complete _chezmoi in zsh.
Observe hang.
Expected behavior
Only chezmoi should have tab completion.
Output of command with the --verbose flag
Not applicable.
Output of chezmoi doctor
$ chezmoi doctorRESULT CHECK MESSAGEwarning version v2.15.2, built at 2022-05-01T17:26:37Zok latest-version v2.15.2ok os-arch linux/amd64 (Arch Linux)ok uname Linux athena 5.17.5-arch1-1 #1 SMP PREEMPT Wed, 27 Apr 2022 20:56:11 +0000 x86_64 GNU/Linuxok go-version go1.18.1 (gc)ok executable /usr/bin/chezmoiok config-file ~/.config/chezmoi/chezmoi.yamlok source-dir ~/.local/share/chezmoi is a directoryok suspicious-entries no suspicious entriesok working-tree ~/.local/share/chezmoi is a directoryok dest-dir ~ is a directoryok shell-command found /bin/zshok shell-args /bin/zshok cd-command found /bin/zshok cd-args /bin/zshok edit-command found /usr/bin/codeok edit-args /usr/bin/code -wrinfo diff-command not setok umask 022ok git-command found /usr/bin/git, version 2.36.0ok merge-command found /usr/bin/bcompareinfo age-command age not found in $PATHok gpg-command found /usr/bin/gpg, version 2.2.35info pinentry-command not setinfo 1password-command op not found in $PATHinfo bitwarden-command bw not found in $PATHinfo gopass-command gopass not found in $PATHok keepassxc-command found /usr/bin/keepassxc-cli, version 2.7.1info keepassxc-db not setinfo lastpass-command lpass not found in $PATHinfo pass-command pass not found in $PATHinfo vault-command vault not found in $PATHinfo secret-command not set
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. The zsh completion script is generated by github.com/spf13/cobra. I've opened spf13/cobra#1690 with you as co-author to fix this.
Describe the bug
The first line in the chezmoi zsh completion is currently (and incorrectly):
ZSH interprets that as the file containing completion for
chezmoi
as well as_chezmoi
. However,_chezmoi
is the completion function itself, and should not be completed by itself (it shouldn't be completed at all).When experimenting trying to tab complete arguments to
_chezmoi
results in zsh hanging (so something is really broken there, probably that to the linerequestComp="${words[1]} __complete ${words[2,-1]}"
results in a recursive call to_chezmoi
).The fix is easy though, change the first line to:
To reproduce
Expected behavior
Only chezmoi should have tab completion.
Output of command with the
--verbose
flagNot applicable.
Output of
chezmoi doctor
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: