manrajgrover / halo

💫 Beautiful spinners for terminal, IPython and Jupyter
MIT License
2.9k stars 149 forks source link

Bug: Colorama init causes all ansi codes to be stripped when not in a tty #151

Open li-wjohnson opened 4 years ago

li-wjohnson commented 4 years ago

Description

$ python -c "import halo; print('\033[93mfail\33[0m')" prints "fail" in red $ python -c "import halo; print('\033[31mfail\33[0m')" | cat prints "fail" without color

This has many effects, including causing pytest --color=yes to stop working.

System settings

Expected behaviour

Importing halo should not affect terminal output. Halo should probably only import colorama on windows, and should not be calling colorama.init.

lemassykoi commented 3 years ago

Hi, same problem currently All my ANSI colors are gone while using Halo 0.0.31

Edit : the fix #152 is actually working well

adamyodinsky commented 1 year ago

Same issue