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

Containers that limit the output does not reset the terminal state (e.g. colors) when printing a new line #37564

Open
KristofferC opened this issue Sep 14, 2020 · 1 comment
Labels
domain:display and printing Aesthetics and correctness of printed representations of objects.

Comments

@KristofferC
Copy link
Sponsor Member

For example:

julia> using Crayons.Box: LIGHT_GREEN_FG; using Random

julia> struct Foo
          b::Int
       end

julia> Base.show(io::IO, f::Foo) = print(io, LIGHT_GREEN_FG(string(f.b)))

julia> d = Dict([randstring(4) => [Foo(rand(Int)) for i in 1:10] for j in 1:5]...)

bild

I think it would be good if the IO supports color and we insert new lines in the middle of user provided show methods to reset the color state of the terminal.

@KristofferC KristofferC added the domain:display and printing Aesthetics and correctness of printed representations of objects. label Sep 14, 2020
@vtjnash
Copy link
Sponsor Member

vtjnash commented Sep 15, 2020

Agreed! I think I had that nearly working in #27430, but then got side-tracked.

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

No branches or pull requests

2 participants