Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipython notebook support fo colored output #1185

Closed
RonnyPfannschmidt opened this Issue Dec 19, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@RonnyPfannschmidt
Copy link
Contributor

RonnyPfannschmidt commented Dec 19, 2018

hi, currently click strips colors when used in code invoked by ipython notebooks

after a short chat on the ipython notebook channel i learned that a commonly suggested workaround is

click.utils.should_strip_ansi = lambda *k, **kw: False and that a reasonably reliable way to detect such a stream is stream.__class__.__module__.startswith('ipykernel.')

i propose setting up isatty to check this in the exception case (aka no tty attribute as the jupyter streams dont have one

additional help will be needed from someone with a windows system, as to me it is not clear whether its required to alter the stream wrapping that is used on win32

@RonnyPfannschmidt RonnyPfannschmidt self-assigned this Dec 19, 2018

RonnyPfannschmidt added a commit to RonnyPfannschmidt/click that referenced this issue Dec 20, 2018

enable colored output on jupyter notebooks
this currently lacks automated tests and is entirely untested on windows

fixes pallets#1185

RonnyPfannschmidt added a commit to RonnyPfannschmidt/click that referenced this issue Jan 8, 2019

enable colored output on jupyter notebooks on unix
this doesn't support windows since i don't have a system
where i could check/test/automate colorama support

fixes pallets#1185

RonnyPfannschmidt added a commit to RonnyPfannschmidt/click that referenced this issue Jan 15, 2019

enable colored output on jupyter notebooks on unix
this doesn't support windows since i don't have a system
where i could check/test/automate colorama support

fixes pallets#1185

davidism added a commit to RonnyPfannschmidt/click that referenced this issue Jan 15, 2019

enable colored output on Jupyter notebooks on UNIX
This doesn't support Windows since I don't have a system where I could
check/test/automate colorama support.

fixes pallets#1185

@davidism davidism closed this Jan 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.