taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

Command does not expand when there are non ascii characters before

Open voidcase opened this issue 5 years ago • 4 comments

  • What command(s) did you run? task add köp mjölk proj<TAB>

  • What did you expect to happen? The command completes to task add köp mjölk project:

  • What actually happened? Nothing

  • Paste the output of the task diag command.

task 2.5.1 Platform: Linux

Compiler Version: 7.2.0 Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64 Compliance: C++11

Build Features CMake: 3.9.5 libuuid: libuuid + uuid_unparse_lower libgnutls: 3.5.8 Build type: None

Configuration File: /home/voidcase/.taskrc (found), 1461 bytes, mode 100644 Data: /home/voidcase/Sync/.task (found), dir, mode 40755 Locking: Enabled GC: Enabled $EDITOR: /usr/bin/nvim Server: Trust: strict Certificate: , not readable, 0 bytes Key: , not readable, 0 bytes Ciphers: NORMAL Creds:

Hooks System: Enabled Location: /home/voidcase/Sync/.task/hooks (-none-)

Tests $TERM: xterm-256color (120x30) Dups: Scanned 43 tasks for duplicate UUIDs: No duplicates found Broken ref: Scanned 43 tasks for broken references: No broken references found

voidcase avatar May 20 '20 22:05 voidcase

Thanks for the bug report. I suggest to change the title to "does not expand". I interpreted "complete" to mean an infinite loop type of issue.

scottkosty avatar Jun 05 '20 14:06 scottkosty

I can confirm the same behavior with the 2.6.0 branch (commit 4b67f10cb1301797e22b0cfe3bb52884af28ca99) and zsh.

heiderich avatar Jun 05 '20 18:06 heiderich

I just started having a look at this. If I am not mistaken this is a pure zsh issue. At least for me it works in bash (besides the obvious difference in completion suggestions):

[max@ArchThinkPad taskwarrior]$ ../src/task rc:test.rc add testä pr<TAB>
prepend   priority  project   projects

I don't have fish installed so was unable to test its behavior.

However, while looking at what happens under zsh I found the following behavior:

% ../src/task rc:test.rc add testä p<TAB>
completing task attributes
depends      -- Other tasks that this task depends upon
description  -- Task description text
due          -- Due date
end          -- Date task was completed/deleted
entry        -- Date task was created
limit        -- Desired number of rows in report
priority     -- priority
project      -- Project name
recur        -- Recurrence frequency
scheduled    -- Date task is scheduled to start
start        -- Date task was started
status       -- Status of task - pending, completed, deleted, waiting
until        -- Expiration date
wait         -- Date until task becomes pending

Whereas: % ../src/task rc:test.rc add testä pr<TAB> will directly expand to precur:. Thus, it is appears as though the completion is ignoring the first non-whitespace character after an Umlaut (multiple whitespaces between testä and p<TAB> behave the same as the above).

The same also happens when using ätest instead of testä so it appears to be a consequence purely of the existence of an umlaut.

And the weirdness continues: % ../src/task rc:test.rc add ätestä p<TAB> expands to pr (because all options starting with a p here will actually start with pr). But now we are back to completing any attribute. Thus, each umlaut appears to cause one non-whitespace char being ignored.

Interesting is also the case of % ../src/task rc:test.rc add ätestä d<TAB> which triggers the correct popup menu containing depends, description and due (which can also be selected normally and are inserted correctly) but adding another char and hitting TAB again (like in de<TAB>) results in the same erroneous behavior as with the pr<TAB> case.

mrossinek avatar Dec 15 '20 21:12 mrossinek

Moving out to 3.0.

tbabej avatar Jun 27 '21 04:06 tbabej