Describe the bug
I have completions (via the autocompletion keyword argument in Arguments and Options) that include a colon (:) in the string. In zsh, these completions get split into completion candidates and help texts at the colon.
To Reproduce
- Create a file
main.py with:
import typer
images = ["alpine:latest", "nvidia/cuda:10.0-devel-ubuntu18.04"]
def _complete(value: str) -> str:
for image in images:
if image.startswith(value):
yield value
app = typer.Typer()
@app.command("image")
def hello(name: str = typer.Option(..., autocompletion=_complete)):
typer.echo(name)
if __name__ == "__main__":
app()
- Trigger autocompletion with [TAB] on ZSH
$ <app_entrypoint> image --name [TAB]
$ <app_entrypoint> image --name [TAB]
alpine -- latest
nvidia/cuda -- 10.0-devel-ubuntu18.04
When I cycle through the completion candidates, only alpine and nvidia/cuda gets filled in.
- But I expected it to output:
$ <app_entrypoint> image --name [TAB]
alpine:latest
nvidia/cuda:10.0-devel-ubuntu18.04
Environment
- OS: Ubuntu 18.04
- Typer Version: 0.3.2
- Python version: 3.7.9
- Zsh version: 5.4.2 (x86_64-ubuntu-linux-gnu)
Additional context
I tried the exact same thing in Bash, and it worked as expected (the output in "But I expected it to output").
Describe the bug
I have completions (via the
autocompletionkeyword argument in Arguments and Options) that include a colon (:) in the string. In zsh, these completions get split into completion candidates and help texts at the colon.To Reproduce
main.pywith:When I cycle through the completion candidates, only
alpineandnvidia/cudagets filled in.Environment
Additional context
I tried the exact same thing in Bash, and it worked as expected (the output in "But I expected it to output").