Skip to content

Commit

Permalink
Support colors in jupyter notebooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
raldone01 committed Oct 21, 2024
1 parent 1368087 commit 6b120cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions colorama/ansitowin32.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def isatty(self):
if 'PYCHARM_HOSTED' in os.environ:
if stream is not None and (stream is sys.__stdout__ or stream is sys.__stderr__):
return True
# Detect if we are running in a jupyter notebook which supports ANSI colors
elif "JPY_PARENT_PID" in os.environ:
return False
try:
stream_isatty = stream.isatty
except AttributeError:
Expand Down

0 comments on commit 6b120cb

Please sign in to comment.