Skip to content

Zsh completions do not work with community go-task packages #2468

@Kaysera

Description

@Kaysera

Description

Current autocompletions for ZSH are designed to work with the command task, which is the main name of the tool. But given that many (community maintained packages)[https://taskfile.dev/docs/installation#community-maintained-package-managers] decide to call the command go-task, the autocompletions do not trigger.

This is because

#compdef task
compdef _task task

reference only the command task and no go-task. Also, here

cmd=(task)

the name task is also hardcoded, which means that even if the autocompletion triggers by changing the compdef the command will not exist or return an error. This could be changed to dynamically check how the command was called (task or go-task)

I think that go-task is a very common name for the command, and the completions could be expanded to take this into account. I have made some initial proof of concept and it is working, so I can open a PR if you think this would be a good addition to the tool. I work mainly in ZSH but if this seems like a good idea I can also work in the other three supported shells to verify if this bug exists and how to address it.

Version

3.44.1

Operating system

Fedora 42

Experiments Enabled

No response

Example Taskfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions