Autocompletion bug with multiple hyphens in options #965
Replies: 4 comments 4 replies
-
@svlandeg @tiangolo this seems like a pretty clear bug, I took a look at the source code but didn't find any unit tests that trigger tab completion. If you can point me in the right direction I'll take a stab at fixing it |
Beta Was this translation helpful? Give feedback.
-
Hi @alexrosenfeld10, thanks for the report! You can find some autocompletion tests in |
Beta Was this translation helpful? Give feedback.
-
@tiangolo possible this could get looked at? It's a pretty common case to have hyphenated autocomplete suggestions, and this totally breaks that |
Beta Was this translation helpful? Give feedback.
-
@tiangolo would be great if we could get some eyes on this, having autocomplete is one of the main things typer writes about in the homepage. Again I'm happy to help if you can point me in the right direction |
Beta Was this translation helpful? Give feedback.
-
First Check
Commit to Help
Example Code
Description
When the above code is run in a CLI and the input
my_cli test --name foo[TAB]
is entered into the shell (where[TAB]
indicates the user pressing tab to autocomplete the--name
argument), the following is the result of the autocompletion:I have observed similar behaviors in slightly different scenarios, for example, if the autocomplete function looks like this instead:
then a similar behavior happens when running
my_cli test --name [TAB]
:Note - if the autocompletion options only have one typo, instead of two or more, it works fine. As in, this has no issue:
Operating System
macOS
Operating System Details
No response
Typer Version
0.12.5
Python Version
3.12.3
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions