jsbueno / terminedia

Python3 library for multimedia functions at the command terminal
GNU Lesser General Public License v3.0
100 stars 8 forks source link

Fix Colors in Windows #17

Open jsbueno opened 4 years ago

jsbueno commented 4 years ago

Current terminal backend uses the "39 SGR" Ansi sequence for 24bit color on the terminal. However, colorama wll simply strip these sequences off, resulting in no color capabilities in windows - even though windows terminal suppots 24bit color, and "cmder" supports the color sequences (and rounds the colors down to the 16 more used values).

Find a way to detect the terminal app under windows, and only trigger "colorama" if on "cmd" - the other apps work with plainANSI sequences. Round colors down to the 16 "well known codes" if on cmd or cmder.