taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

Not getting zsh completion for `project:` in commands

Open sdondley opened this issue 2 years ago • 6 comments

When I try to do completion for the project: element in a command, nothing happens when I <TAB> to try to complete a project name.

Example: task list project:Cli<TAB>

nothing happens despite having several project names that being with Cli

Other completions work perfectly fine.

i'm running 2.6.1 of TW and oh_my_zsh with the taskwarrior plugin. Not sure if this is a TW issue or oh_my_zsh.

sdondley avatar Mar 13 '22 01:03 sdondley

Just played with it a little more.

So it works with task all project:Cli and other reports as well. I wonder if maybe one of my aliases is confusing it.

sdondley avatar Mar 13 '22 02:03 sdondley

I disabled all my TW aliases and fired up a fresh shell. Problem still exists.

sdondley avatar Mar 13 '22 02:03 sdondley

Found a workaround. If I do task project:Cli<TAB> it works and then I can throw in list at the end.

This is not ideal as I have tl aliased to task list so I won't be able to get completion working when I use that alias. I guess I'll have to create a function to handle this.

I'll leave this open in case it's a bug.

sdondley avatar Mar 13 '22 02:03 sdondley

One other small issue. When I do task all proj<tab>, the colon will appear automatically after project. With task proj<tab>, I have to type in the colon manually.

sdondley avatar Mar 13 '22 02:03 sdondley

Not a zsh user myself, but we should look into whether we can setup test case(s) for shell completion. Issues of this sort pop up every once in a while.

tbabej avatar Mar 14 '22 04:03 tbabej

One other small issue. When I do task all proj<tab>, the colon will appear automatically after project. With task proj<tab>, I have to type in the colon manually.

Think that is because there are two ways proj can be completed: project: and projects where project is an attribute and projects is a report that lists all projects. Since "all" already is a command (a report itself) proj after "all" will no longer consider expanding to projects and thus expands to the only option "project:". In the other case it is bringing you as far as possible but as there is ambiguity you have to enter either the colon or the "s" manually.

jaker-dotcom avatar Apr 01 '22 19:04 jaker-dotcom