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

ipykernel.iostream.OutStream.isatty() should be True. #680

Closed
real-yfprojects opened this issue Jun 1, 2021 · 1 comment · Fixed by #683
Closed

ipykernel.iostream.OutStream.isatty() should be True. #680

real-yfprojects opened this issue Jun 1, 2021 · 1 comment · Fixed by #683
Milestone

Comments

@real-yfprojects
Copy link

real-yfprojects commented Jun 1, 2021

I was redirected from qtconsole. I posted this Issue over there.

A stream's method isatty should return whether it is an 'interactive' stream. I think that means whether it is an interactive console.

Although qtconsole is an interactive stream their sys.stdout.isatty() returns False. This is because qtconsole uses ipykernel.iostream.OutStream as standard streams for sys.stdout and sys.stderr. This class inherits the method isatty() from io.TextIoBase which isn't supposed to be an interactive stream by default.

class OutStream(TextIOBase):

One of the current main developers of qtconsole told me:

Please open this issue in the ipykernel repo because we can't solve it here and a change as the one you're suggesting will also affect the Jupyter notebook and JupyterLab.


This Issue relates to #268 .

@peendebak
Copy link

@real-yfprojects I don't have a strong opinion on whether the isatty() should be patched here, or in qtconsole, but I would like to see this addressed as well. It would solve problems with colored output in spyder (see Textualize/rich#1221 and the references there)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants