-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Milestone
Description
Completions for parameters in quotes, partially quoted or with escaped characters (e.g. whitespace) don't work properly for Fish shell.
I believe the issue is that for fish completion, the incomplete paramater is passed through the COMP_CWORD environment variable and it's expected that it will be contained in COMP_WORDS as the last parameter. However, before doing this match COMP_WORDS is parsed, which quotes and unescapes the parameters, while COMP_CWORD is not causing the match to fail. See code here.
How to replicate
Consider the following command
@click.command()
@click.argument('bar', type=click.Choice(('hello world',)))
def main(bar: str):
passTrying to complete foo hello in Fish will correctly return completion for foo hello\ world.
The following incomplete commands will not return any completions
foo hello\foo "hellofoo "hello"
Environment:
- Python version: 3.13.5
- Click version: 8.2.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels