Skip to content

Properly support multiline help string and fix broken fish completion from #3126#3504

Merged
kdeldycke merged 2 commits into
pallets:mainfrom
sitiyou:fix-fish-completion
May 23, 2026
Merged

Properly support multiline help string and fix broken fish completion from #3126#3504
kdeldycke merged 2 commits into
pallets:mainfrom
sitiyou:fix-fish-completion

Conversation

@sitiyou
Copy link
Copy Markdown
Contributor

@sitiyou sitiyou commented May 22, 2026

See #3502 for details.

This PR reverts the changes introduced in #3126 and properly handles multi-line help strings by quoting \n and replacing \t with a space.

According to the Fish documentation:

Command substitutions found in ARGUMENTS should return a newline-
separated list of arguments, and each argument may optionally have a tab
character followed by the argument description.

fix #3043 and #3502

@sitiyou sitiyou force-pushed the fix-fish-completion branch from 82fdd69 to 31eb163 Compare May 22, 2026 16:35
@davidism davidism added this to the 8.4.2 milestone May 22, 2026
@kdeldycke kdeldycke added bug f:completion feature: shell completion labels May 23, 2026
@kdeldycke
Copy link
Copy Markdown
Collaborator

OK so #3126 was a PR introducing a regression that was merge too early and broke fish completion in 8.4.0. The fix was naive as newlines can't serve double duty as both item and field separator in fish, as @sitiyou just pointed out.

This PR apply the right sanitation proposed in #3126 of escaping newline characters \n.

The deeper issue is that nowhere in Click do we run fish code with fish. But that's another work entirely.

So this is good to me to be merged.

@kdeldycke kdeldycke requested a review from AndreasBackx May 23, 2026 07:01
@kdeldycke kdeldycke linked an issue May 23, 2026 that may be closed by this pull request
@kdeldycke kdeldycke merged commit c353590 into pallets:main May 23, 2026
12 checks passed
@kdeldycke
Copy link
Copy Markdown
Collaborator

Arf. I messed up and merged this issue to main instead of stable. Will fix it.

@kdeldycke
Copy link
Copy Markdown
Collaborator

A fix for the wrong merge target is being worked on at #3508

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug f:completion feature: shell completion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fish completion is broken in 8.4.1 Multi-line help text is not handled correctly in fish

3 participants