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

Ship a sensible default light color scheme #14859

Open
mcclure opened this issue Feb 15, 2023 · 9 comments
Open

Ship a sensible default light color scheme #14859

mcclure opened this issue Feb 15, 2023 · 9 comments
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Milestone

Comments

@mcclure
Copy link

mcclure commented Feb 15, 2023

Description of the new feature/enhancement

In #14844 there is an interesting comment from a Terminal team member:

We really wanted to revisit the fact that for most users (who haven't set the OS theme), when they launch the Terminal, they get a window that's mostly black, with a white titlebar. This contrast seemed a little silly to us.

Well, that is a little silly, but there's another way to address the silliness: what if the window contents were some color other than black?

I personally prefer black text on a light background for my terminals. However, Windows Terminal does not realistically support this. There is a "color schemes" feature and several included light themes, but they do not work with out-of-the-box Windows Services for Linux. By "do not work" I mean that the ubuntu defaults result in extremely light text on a white background, or dark text on a dark background. For example here's the One Half Light theme running "ls":

image

Look how difficult this is to read if there are one-letter directories:

image

I obtained all three of Windows Terminal, WSL, and One Half Light from Microsoft, but despite all being in some sense Microsoft products they are configured in a way that using the three at the same time does not work.

Moreover, selections are still white-background with One Half Light, so it's very hard to tell which areas are selected:

image

Proposed technical implementation details (optional)

I'm not sure I know exactly why this is happening and I don't know what the solution would be. Maybe there is a Terminal color scheme somewhere on the Internet that fixes it fully, maybe I can configure something within Bash to change the colors WSL outputs. But given MS Terminal does ship the One Half Light theme out of the box, it would be reasonable to expect it to work out of the box.

Moreover, I note Apple's Terminal.app does not have this problem without anything needing to be configured— it has a (default) light-on-black scheme and it works fine even when SSHing into remote servers where nothing has been preconfigured. I think the way Apple swung this was they silently invert the color of all foreground or background terminal colors. This probably makes multicolor ANSI art look wrong, but since that basically never comes up it is okay.

My "expected behavior" is that Terminal should ship with at least one color scheme with a light background that can be used without making things unreadable and without me needing to edit any JSON, whatever is necessary to make that happen.

@mcclure mcclure added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Feb 15, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Feb 15, 2023
@237dmitry

This comment was marked as off-topic.

@zadjii-msft
Copy link
Member

zadjii-msft commented Feb 17, 2023

Alrighty there's a lot to unpack here.

Forst off - the selection thing is tracked in #8716, so I won't touch that.

You're right that the "One Half Light" colors are fairly hard to read. Here's OHL vs OHD:
image. The blue and green combo ls uses has been a perennial thorn in our side.

Looks like we got those schemes from https://github.com/sonph/onehalf. Not sure if they've been updated since, maybe that's something to take a look at. I think we initially tried to ship some halfway decent, inoffensive schemes, but alas, pretty much all of them have burned us.

I'm gonna just take this as an action item for "ship a sensible default light scheme". It can probably just be "Campbell Light", with the foreground & background reversed.


As an addenda, @DHowett mentioned correctly that we should probably figure out "don't put all the default color schemes in the user's settings file" before shipping this. I believe he had a WIP PR over in #12800. That PR also attempted to remove the default schemes from the user's file, if they were left there by an earlier version ("healing" the file). That's probably the hardest part.

@zadjii-msft zadjii-msft changed the title Light color schemes don't actually work Ship a sensible default light color scheme Feb 17, 2023
@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Feb 17, 2023
@zadjii-msft zadjii-msft added this to the Terminal v1.18 milestone Feb 17, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Tag-Fix Doesn't match tag requirements label Feb 17, 2023
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Feb 17, 2023
@mcclure
Copy link
Author

mcclure commented Feb 17, 2023

Neat!

One thing I wonder: The color scheme only seems(??) to include 16 colors; is it worth worrying about what if an app (Linux or Windows) uses ANSI color codes 16 through 255? For example if your scheme only rewrites 0-15, then background 15 and foreground 16 might look like black on black.

@237dmitry
Copy link

237dmitry commented Feb 17, 2023

There are base 16 console colors, plus foreground, background, selection and cursor. Color scheme replaces these 16 colors with their own.

(Linux or Windows) uses ANSI color codes 16 through 255?

A palette of 256 colors is given for convenience, this is the generally accepted standard. In practice, this palette is enough for the console, but no one forbids the use of RGB colors.

@PinkSerenity
Copy link

I think a solution of changing the expected colors as implemented by Apple's Terminal is at most a workaround that should not be considered as the end of the problem. Of course an inverted mode should still be included as a feature, but the big underlying issue is that there is no convention on how to tell command line shells and programs whether to use light or dark mode.

However, terminals and programs have become aware of it and have proposed different solutions. The xterm and the vte library specify OSC 10 and OSC 11 for querying text foreground and background, respectively. This is utilized be Emacs running on these terminals. Rxvt on the other hand sets a new environment variable COLORFGBG.

However, both of these solutions aren't widely supported. I still suggest implementing them in Windows Terminal (if they aren't already implemented), because "be the change you want to see".

Source

@zadjii-msft
Copy link
Member

@Tojaw the OSC10 (et al) queries are tracked in #3718

@kfsone
Copy link

kfsone commented May 23, 2023

The problem is that there's no readable default Light Mode color scheme.

One Half Light results in ".." in powershell being invisible. Tango Light uses light gray for concrete typing but dark for autocomplete which is confusing.

One half light:
image

Solarized Light:
image

Tango Light:
image

Is this an issue with powershell using colors by name instead of role?

@kyle-semc
Copy link

I've made a few fixes to colors that made it impossible to work.

  • SelectionBackground now matches cursorColor (instead of the background)
  • The whites are now more of a grey to stand out from the background as well (brightBlack from Half Dark)
  • Swapped colors with their 'bright' variants (the whiter ones are harder to see)
{
    "name": "One Half Light",
	"foreground": "#383A42",
	"background": "#FAFAFA",
	"cursorColor": "#4F525D",
	"selectionBackground": "#4F525D",
	"black": "#282C34",
	"brightBlack": "#282C34",
	"brightWhite": "#5A6374",
	"white": "#5A6374",
	"blue": "#61AFEF",
	"cyan": "#56B6C2",
	"green": "#98C379",
	"purple": "#C678DD",
	"red": "#E06C75",
	"yellow": "#E5C07B",
	"brightBlue": "#0184BC",
	"brightCyan": "#0997B3",
	"brightGreen": "#50A14F",
	"brightPurple": "#A626A4",
	"brightRed": "#E45649",
	"brightYellow": "#C18301",
},

@zadjii-msft zadjii-msft modified the milestones: Terminal v1.19, Backlog Aug 17, 2023
@sassdawe
Copy link

Could I bring to your attentionPresentLight? https://gist.github.com/sassdawe/2006949bf04ebdf1d5627e6fac3f1db7

This was born during PSConfEU as no one had a good light theme to present on the big "screen". I think this would be very handy if included in the default install - to be used on throw-away virtual machines created for conference demos.

I am not really sure how could I submit a PR with this, but with some direction I'd be happy to create one!

DHowett added a commit that referenced this issue Aug 19, 2024
…a overlay (#17725)

With the merge of #17638, selections are now accumulated early in the
rendering process. This allows Atlas, which currently makes decisions
about cell foreground/background at the time of text rendering,
awareness of the selection ranges *before* text rendering begins.

As a result, we can now paint the selection into the background and
foreground bitmaps. We no longer need to overlay a rectangle, or series
of rectangles, on top of the rendering surface and alpha blend the
selection color onto the final image.

As a reminder, "alpha selection" was always a stopgap because we didn't
have durable per-cell foreground and background customization in the
original DxEngine.

Selection foregrounds are not customizable, and will be chosen using the
same color distancing algorithm as the cursor. We can make them
customizable "easily" (once we figure out the schema for it) for #3580.

`ATLAS_DEBUG_SHOW_DIRTY` was using the `Selection` shading type to draw
colored regions. I didn't want to break that, so I elected to rename the
`Selection` shading type to `FilledRect` and keep its value. It helps
that the shader didn't have any special treatment for
`SHADING_TYPE_SELECTION`.

This fixes the entire category of issues created by selection being an
80%-opacity white rectangle. However, given that it changes the imputed
colors of the text it will reveal `SGR 8` concealed/hidden characters.

Refs #17355
Refs #14859
Refs #11181
Refs #8716
Refs #4971
Closes #3561
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

7 participants