Open mcclure opened 1 year ago
I think it's because of the different color order in Windows and other systems. Compare:
Accordingly, the order of colors in color schemes is perceived differently in Linux and Windows.
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:
. 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.
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.
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.
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".
@Tojaw the OSC10 (et al) queries are tracked in #3718
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:
Solarized Light:
Tango Light:
Is this an issue with powershell using colors by name instead of role?
I've made a few fixes to colors that made it impossible to work.
{
"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",
},
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!
Description of the new feature/enhancement
In #14844 there is an interesting comment from a Terminal team member:
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":
Look how difficult this is to read if there are one-letter directories:
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:
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.