Skip to content

fish completion is broken in 8.4.1 #3502

@sitiyou

Description

@sitiyou

Commit 19fd4d6 (#3126) broke fish completion.

Unquoted \n

-        set -l metadata (string split "," $completion);
+        set -l metadata (string split \n $completion);

Without quotes, \n is evaluated as a literal newline, which splits the command across lines in the generated script:

        set -l metadata (string split
 $completion);

Command substitution flattens newlines

Even if quoted, \n fails as a separator. The Python side outputs:

        return f"{item.type}\n{value}\n{help_escaped}"

But when captured via command substitution in Fish, the newlines are flattened:

    set -l response (env %(complete_var)s=fish_complete COMP_WORDS=(commandline -cp) \
COMP_CWORD=(commandline -t) %(prog_name)s);

To support multi-line, maybe we just need to escape \n in help message while keeping the old separator? Not 100% sure.

Either way, we should probably revert this change first to fix the broken completion

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions