Comment by zahlman

Comment by zahlman a day ago

1 reply

In the Python world, people often enough use Rich so that they can put codes like [red] into a string that are translated into the corresponding ANSI. The end user pays several megabytes for this by default, as Rich will also pull in Pygments, which is basically a collection of lexers for various programming languages to enable syntax highlighting. They also pay for a rather large database of emoji names, a Markdown parser, logic for table generation and column formatting etc. all of which might go unused by someone who just doesn't want to remember \e[31m (or re-create the lookup table and substitution code).

joquarky 6 hours ago

Exactly! ANSI escape codes are old and well defined for all the basic purposes.

Pulling in a huge library just to set some colors is like hiring a team of electrical contractors to plug in a single toaster.