Skip to content

Does each text IO or Display object need to maintain a color stack? #9353

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

Closed
timholy opened this issue Dec 14, 2014 · 2 comments
Closed

Does each text IO or Display object need to maintain a color stack? #9353

timholy opened this issue Dec 14, 2014 · 2 comments
Labels
display and printing Aesthetics and correctness of printed representations of objects.

Comments

@timholy
Copy link
Member

timholy commented Dec 14, 2014

The positive responses to #9349 encouraged me to look into one obvious bug: once it prints something in red, it goes back to :normal rather than :bold printing. It seems to me that fixing this properly means that each relevant display object should maintain state as a stack, and with_output_color should push! and pop! from the stack.

However, I really don't know much about our Display infrastructure or terminals & display in general, so I'm soliciting advice/involvement from experts like @stevengj and @StefanKarpinski.

@ivarne ivarne added the help wanted Indicates that a maintainer wants help on an issue or pull request label Dec 14, 2014
@ihnorton ihnorton added io Involving the I/O subsystem: libuv, read, write, etc. needs decision A decision on this change is needed and removed help wanted Indicates that a maintainer wants help on an issue or pull request labels Dec 15, 2014
@vtjnash
Copy link
Member

vtjnash commented Mar 25, 2016

yes.

see #14052 for discussion

@vtjnash vtjnash removed the needs decision A decision on this change is needed label Mar 25, 2016
@JeffBezanson JeffBezanson added display and printing Aesthetics and correctness of printed representations of objects. and removed io Involving the I/O subsystem: libuv, read, write, etc. labels Jan 3, 2017
@KristofferC
Copy link
Member

I think it is unlikely for more advanced color printing to get into Base. To note, Crayons.jl does support exactly this kind of stack: https://github.com/KristofferC/Crayons.jl#advanced-nesting-of-colors-and-styles so in the spirit of moving things out of Base, pointing to that package seems good enough for now. If we need it for our own error reporting it could be brought in later in some sort of standard library style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

No branches or pull requests

6 participants