fix(completion): zsh completion supports aliases#2866
Open
toby-griffiths wants to merge 1 commit into
Open
Conversation
Parse the `(aliases: ...)` parenthetical from `task --list-all` output and add each alias as a separate completion entry, so typing an alias prefix and pressing Tab now completes correctly. When verbose mode is on, aliases are shown with an "alias for <task>" description. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'd noticed that alias would not autocomplete on MacOS with zsh, so taking inspiration from it being fixed in fish, I thought I'd fix the zsh issue. I had a good search for any previous discussion on this, but didn't turn anything up, so apologies if I've missed this somewhere.
Claude & Co-Pilot did a lot of the heavy lifting here, but I've reviewed the code any believe it all to be good and proper.
The Fix
The ZSH completion script not parses the
(aliases: ...)parenthetical fromtask --list-alloutput and add each alias as a separate completion entry, so typing an alias prefix and pressing Tab now completes correctly. When verbose mode is on, aliases are shown with an "alias for " description.Tests
As this is a shell script I've not written tests, however Co-Pilot provided the following script to validate the logic, in cause it's useful, or you want this integrtaing into this PR as a test file somehow (please advise how)…