taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

An alias to "execute task-*" confuses task

Open madduck opened this issue 6 years ago • 2 comments

Using task 2.6.0 (at commit 51a5a73c0, but also on the master branch), the following command:

task rc.alias.attach='execute task-attach' attach …

really confuses task, which seems to handle the task-* prefix specially. According to strace, the above results in the following call:

[pid 25304] execve("/bin/sh", ["sh", "-c", "- task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - execute task - attach 33"], 0x7ffd7da8e000 /* 56 vars */) = 0

Using task_attach works, as does anything-else.

Note that using anything-doesnotexist actually causes task to attempt to evaluate the expression:

~/.bin% task rc.alias.test='execute task-nonexistent' test
[task next ( - nonexistent )]
Cannot subtract strings
Configuration override rc.alias.test:execute task-nonexistent
~/.bin% task rc.alias.test='execute foo-nonexistent' test 
sh: 1: foo: not found
Configuration override rc.alias.test:execute foo-nonexistent

madduck avatar Jan 30 '19 22:01 madduck

Good find, thanks.

pbeckingham avatar Feb 07 '19 13:02 pbeckingham

Reproduced on 2.6.0.

tbabej avatar Dec 10 '20 04:12 tbabej