When a value with an escape string, for instance my\ file, is passed to a click.ParamType, the incomplete value which is passed to click.ParamType.shell_complete will only be "my\ " instead of my file.
Expected Behavior
import click
@click.command()
@click.argument("name", type=click.Choice(["my file", "my folder", "my\\ file", "other"]))
def cli(name):
click.echo(name)
if __name__ == '__main__':
cli()
Completing my\ f should be interpreted as the Python string "my f" and match the first two values.
$ example my\ f<TAB>
my\ file
my\ folder
Actual Behavior
Completing my\ f is interpreted as the string "my\\ f" and matches the third value.
$ example my\ f<TAB>
my\\\ file
Environment
- Python version: 3.8.6
- Click version: 8.0.0.dev0
When a value with an escape string, for instance
my\ file, is passed to aclick.ParamType, theincompletevalue which is passed toclick.ParamType.shell_completewill only be"my\ "instead ofmy file.Expected Behavior
Completing
my\ fshould be interpreted as the Python string"my f"and match the first two values.Actual Behavior
Completing
my\ fis interpreted as the string"my\\ f"and matches the third value.Environment