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
Commit 19fd4d6 (#3126) broke fish completion.
Unquoted
\nWithout quotes,
\nis evaluated as a literal newline, which splits the command across lines in the generated script:Command substitution flattens newlines
Even if quoted,
\nfails as a separator. The Python side outputs:But when captured via command substitution in Fish, the newlines are flattened:
To support multi-line, maybe we just need to escape
\nin help message while keeping the old separator? Not 100% sure.Either way, we should probably revert this change first to fix the broken completion