-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Fix ANSI inverse #2967
Fix ANSI inverse #2967
Conversation
This is a companion PR to jupyter/notebook#2967.
That looks like a very elegant way to "fake" inverse support with CSS! However, one problem I'm seeing in my output is that it appears to be assuming that the background color (which becomes the foreground of the inverse) is white when it may not be. Example: I suspect there's no reliable way to deal with that given the need to precompute styles ahead of time and not knowing what the background will be... But if there must be a default, I would think black foreground would be the most sensible, since the ANSI stuff tends to be used for terminal output, and terminals have traditionally used black as the default background. |
@tonycpsu Thanks for checking this out! It indeed assumes that the default text color is black and the background is white. If I'm supposed to make this customizable, I could try to define two new CSS classes like |
It's from a notebook (console output from cdiff) but I use Relevant .output {
font-family: Menlo,Consolas,Lucida Console,monospace;
font-size: 9pt;
}
div.output_area pre {
font-family: Menlo;
background: #202020;
color: #37f14a;
}
div.output_area pre::selection {
color: #202020;
background: #37f14a;
}
div.output_area pre::-moz-selection {
color: #202020;
background: #37f14a;
} I like your idea of new classes for the default fg/bg that I could just override in |
Looks perfect! Thanks so much for doing this! |
@mgeier Is this ready to merge? |
The "inverse" escape sequence was implemented in jupyter#2186, but not by actually inverting foreground and background.
ab7b19d
to
2068de7
Compare
@gnestor Thanks for the review! Yes, I think this is ready. I've rebased this PR in order to get rid of the AppVeyor error. The only remaining question is if you are OK with adding two additional CSS classes and if the names |
Yes and yes. Thanks @mgeier!! |
The "inverse" escape sequence was implemented in #2186, but not by actually inverting foreground and background.
@tonycpsu Since you created the original "inverse" implementation, can you please check if that's OK for you?