zsh/completion: put compdef on first line#14410
Conversation
Some zsh setups (including mine) do not load the completion if `#compdef` is not on the first line. So we move the `# shellcheck` comment to the second line to avoid this issue.
|
Is there a comment or rationale explaining why "some" don't work but others do ? |
|
Ultimately the file is disabled for shellcheck so I don't think it really matters but I personally dislike making changes without knowing why :P |
|
Thank you. I was wondering why zsh completions broke |
|
Successfully created backport PR for |
I am just saying that at least it broke on my system. Maybe it breaks on everyone else's as well, or maybe it doesn't 😆 It is very hard to track down all the zsh config files (system / user level, .profile or .zshrc etc) that might change how zsh behaves1... And surely I have no understanding of its completion system... Though after some searches I found this in their doc which seems to suggest that it might have been breaking everyone's setup:
https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Autoloaded-files Footnotes
|
Motivation
Some zsh setups (including mine) do not load the completion if
#compdefis not on the first line. So we move the# shellcheckcomment to the second line to avoid this issue.Context
The
# shellcheckcomment is introduced in 8839bab so cc @fzakaria for comments and review!Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.