kennethreitz / crayons

Text UI colors for Python.
https://pypi.python.org/pypi/crayons
MIT License
423 stars 30 forks source link

Fixes Issue #9 #13

Open kathawala opened 6 years ago

kathawala commented 6 years ago

Issue #9 shows that ANSI escape sequences aren't detected when coloring strings, which leads to a ColorString formatted with another ColorString to lose its color information at the end. This fix finds any ANSI escape sequences using re and works around them.

As a test case:

terminal shot showing formatted color strings nested successfully

kennethreitz commented 5 years ago

resolve conflicts?

MasterOdin commented 5 years ago

Looks like this causes an infinite hang on my machine on your text example in both 2.7 and 3.7. Will try and play around more with this and figure out what's going on and why it worked 2 years ago and not now.