You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How should one implement a styled show method that works with PrettyTables? The IO passed to the show method indicates colors are okay, but PrettyTables prints the ANSI codes. I'm sure this is due to the (very cool) highlighting features of PrettyTables, but how would one handle both colors in the REPL and no ANSI codes in the pretty_table?
Maybe PrettyTables should at least be passing IOContext(io, :color => false) to the show methods of the elements?
julia>using PrettyTables
julia>struct A end
julia> Base.show(io::IO, ::A) = (@info(get(io, :color, false)); printstyled(io, "AAAA", color=:red))
julia>A()
[ Info:true
AAAA # this is red
julia>pretty_table([A()])
[ Info:true
┌──────────────────┐
│ Col. 1 │
├──────────────────┤
│ \e[31mAAAA\e[39m │
└──────────────────┘
The text was updated successfully, but these errors were encountered:
How should one implement a styled show method that works with PrettyTables? The IO passed to the show method indicates colors are okay, but PrettyTables prints the ANSI codes. I'm sure this is due to the (very cool) highlighting features of PrettyTables, but how would one handle both colors in the REPL and no ANSI codes in the
pretty_table
?Maybe PrettyTables should at least be passing
IOContext(io, :color => false)
to the show methods of the elements?The text was updated successfully, but these errors were encountered: