Replies: 1 comment 2 replies
-
Maybe it's on purpose that any path is considered 'complete' even paths that don't exist? If so, maybe specifying exists=True could modify that? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
As the example mentions, autocomplete for paths or files depends on the text cursor not moving. Whenever you try to autocomplete a typer.Argument, except the first time (before you write anything and incomplete is empty), even if you return a empty list you get a space added to the end. If you do that (return a empty list) in a Option shell_complete function, it instead fall-backs to the cmd line path autocomplete correctly, with no space added which allows autocomplete to function.
I don't get this inconsistency. Actually it might not even be adding the autocomplete to the argument, because i just printed something there and nothing happened.
I added the autocomplete in a attempt to workaround this behavior, which is the default.
edit: shell_complete doesn't work as a argument to ... Argument, but autocompletion=complete_path does. In that case, the program doesn't add a space at the end and it works as expected.
Operating System
Linux
Operating System Details
No response
Typer Version
0.9.0
Python Version
Python 3.10.6
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions