Closed dwreeves closed 5 months ago
It's best to allow Rich to generate the escape sequences. If you can't avoid using strings with ansi codes, you can use Text.from_ansi
which will convert the escape sequences in to an equivalent Text instance.
Ah! I did not know about that. That works! Thank you 😄
I hope we solved your problem.
If you like using Rich, you might also enjoy Textual
Describe the bug
A user encountered this in our repo: https://github.com/ewels/rich-click/issues/192
A simplified version of the user's issue can be seen here:
The difference in the raw string length is 9, and the Panel is 7 characters too small:
plaintext:
The expected behavior was that Rich would exclude these ANSI escape characters from the padding, even though they did not come explicitly from Rich markup.
Platform
Platform: OSX Ventura 13.6, Apple M2 Max Terminal: zsh inside PyCharm