timofurrer / colorful

Terminal string styling done right, in Python :snake: :tada:
MIT License
525 stars 23 forks source link

detect color support for Jupyter Notebook #38

Open keturn opened 4 years ago

keturn commented 4 years ago

Jupyter Notebook's web interface supports truecolor escape codes in stdout!

A screenshot of colored text from JupyterLab

As does the Qt Console, it looks like.

It'd be nice for colorful to default to using color when in a Notebook!

keturn commented 4 years ago

It doesn't currently, of course, because it knows it is not attached to a TTY.

It's a hard thing to figure out, because you're running in some ipython kernel far away from the renderer.

tqdm is trying to figure it out. It's still labeled "experimental": https://github.com/tqdm/tqdm/blob/master/tqdm/autonotebook.py