astanin / python-tabulate

Pretty-print tabular data in Python, a library and a command-line utility. Repository migrated from bitbucket.org/astanin/python-tabulate.
https://pypi.org/project/tabulate/
MIT License
2.1k stars 163 forks source link

Coloring output with blessed module #269

Open ajgringo619 opened 1 year ago

ajgringo619 commented 1 year ago

I think I'm running into the issue mentioned under ANSI Support. When using the blessed module for coloring, the column widths are way off, so I checked the actual string and it's something like this:

f"{term.green}testing{term.normal}" --> '\x1b[32mtesting\x1b(B\x1b[m'

I've used the escape sequences, and they were fine. But since I'm already using blessed, I wanted my code to be uniform. Is there anything I can do to work around this?