Replies: 1 comment
-
I confirm that I see this behavior >=0.13.1. I also started seeing ansi color control sequences come through on some systems. |
Beta Was this translation helpful? Give feedback.
0 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
What I think happens here is that changes introduced in #877 which make use of
typer.rich_utils.print_with_rich
to print out the autocompletion yield malformed completions.To be more precise
rich.Console.print
does no preserve"\t"
which acts as the separator between the item and item help in the completion, so invokingconsole.print(text)
in the aforementioned method inadvertently replaces the"\t"
. Rich has made it pretty clear that they do not intend to implement behaviour that preserves tabs here. This means that the current code completions are properly generated only for some shells. This could be circumvented eg. by implementing something to the likes ofand then using it directly to format the help text for the completion in the designated
format_completion
method of a given shell completion class eg. for fish shellThis approach:
console.print
so changes from ✨ Remove Rich tags when showing completion text #877 intyper.completions.py
could be reverted to:which preserves the proper output formatting.
Final thoughts:
Operating System
macOS
Operating System Details
No response
Typer Version
0.14.0
Python Version
Python 3.12.7
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions