snoop icon indicating copy to clipboard operation
snoop copied to clipboard

Broken coloring when used with `tqdm`

Open offchan42 opened this issue 4 years ago • 4 comments

I see that when I do from tqdm import tqdm and then run pp(a_variable) There is no color for the pp() message anymore. So my work around was to import tqdm as late as possible. Is this problem with snoop or tqdm? How can we fix this? This happens on Windows 10 command prompt.

tqdm Link: https://github.com/tqdm/tqdm

offchan42 avatar Oct 29 '19 18:10 offchan42

What happens if you uninstall colorama?

alexmojaki avatar Oct 29 '19 19:10 alexmojaki

It seems like uninstalling colorama fixes the issue. What does it mean then?

offchan42 avatar Oct 29 '19 19:10 offchan42

tqdm uses colorama (if it's available) to process ANSI escape codes in Windows. Windows only recently started supporting those escape codes natively. snoop relies on that new ability instead of colorama, which is the traditional solution to the lacking support. colorama was probably stripping the escape codes, although I'm not sure. I'm not on a Windows machine.

alexmojaki avatar Oct 29 '19 21:10 alexmojaki

It seems that I cannot use ipython when I remove colorama. image Any workaround?

offchan42 avatar Nov 03 '19 12:11 offchan42