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

Reverse color mode doesn't work when using a light theme #759

Closed
Tyriar opened this issue Jul 5, 2017 · 9 comments
Closed

Reverse color mode doesn't work when using a light theme #759

Tyriar opened this issue Jul 5, 2017 · 9 comments
Assignees
Labels
type/bug Something is misbehaving
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jul 5, 2017

Downstream issue: microsoft/vscode#30024

JS has no knowledge of the background/foreground colors so it just uses .xterm-bg-color-15 and .xterm-color-0 for reversed unstyled text which should be the opposite on light themes.

@Tyriar Tyriar added the type/bug Something is misbehaving label Jul 5, 2017
@Tyriar
Copy link
Member Author

Tyriar commented Jul 6, 2017

Currently the default background/foreground is specified in the following CSS:

#terminal-container .terminal {
    background-color: #111;
    color: #fafafa;
}

@wavebeem
Copy link
Contributor

wavebeem commented Jul 7, 2017

Related: reverse video + red foreground on a light theme gives black text on a red background, rather than white text on a red background:

image

@Tyriar
Copy link
Member Author

Tyriar commented Jul 7, 2017

Yep, that's the same root cause. reverse on defaults is always assumed it was default black bg and default white fg..

@wavebeem
Copy link
Contributor

wavebeem commented Jul 7, 2017

Cool, just figured I'd add that since I wasn't 100% sure if it would affect the issue or not.

@jerch
Copy link
Member

jerch commented Jul 10, 2017

Imho this could be solved by enforcing a default class settings identifiable by the emulator so the emulator can reverse those settings when needed, e.g. .fg-default and .bg-default. This would involve copying the settings over from fb to bg and vice versa for reversed.
Might be even easier to enforce default reversed classes in the theme settings, e.g. .fg-reversed and .bg-reversed. With those the theme creator is responsible to set those values to a reversed scheme.

For all other non default color settings reversed should simply swap fg and bg settings, e.g. .xterm-bg-color-15 becomes .xterm-fg-color-15 and so on...

Btw as far as I know xterm simply reverses colors when higlighting with the mouse.

@Tyriar
Copy link
Member Author

Tyriar commented Jul 10, 2017

Yes we used to reverse color as well in vscode and I really liked it. Unfortunately it's not the easiest thing to support using the new SelectionManager.

@Tyriar
Copy link
Member Author

Tyriar commented Oct 20, 2017

This was fixed with the renderer update.

@dcalhoun
Copy link

This was fixed with the renderer update.

@Tyriar would you be able to elaborate on what commit/change was the fix? I'm still experiencing a similar issue that is outlined in jestjs/jest#6494.

@Tyriar
Copy link
Member Author

Tyriar commented Sep 23, 2018

I commented on the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is misbehaving
Projects
None yet
Development

No branches or pull requests

4 participants