Windows Terminal can display brown but cant configure it in the settings json ? #19472

Closed
opened 2026-01-31 06:44:17 +00:00 by claunia · 19 comments
Owner

Originally created by @ghost on GitHub (Feb 28, 2023).

image
So as you can see the terminal can display hardcoded brown, but it cant set it in the settings json.
image

Originally created by @ghost on GitHub (Feb 28, 2023). ![image](https://user-images.githubusercontent.com/107933013/221732835-9e15baf3-4339-485a-876d-82f940a6ecac.png) So as you can see the terminal can display hardcoded brown, but it cant set it in the settings json. ![image](https://user-images.githubusercontent.com/107933013/221733010-f8d353c9-3e75-4037-a195-950dab6a625c.png)
Author
Owner

@237dmitry commented on GitHub (Feb 28, 2023):

This is an invalid parameter name.

@237dmitry commented on GitHub (Feb 28, 2023): This is an invalid parameter name.
Author
Owner

@ghost commented on GitHub (Feb 28, 2023):

i know its invalid, im trying to show that i cant define brown in the config, so i cant customize that color.

@ghost commented on GitHub (Feb 28, 2023): i know its invalid, im trying to show that i cant define brown in the config, so i cant customize that color.
Author
Owner

@237dmitry commented on GitHub (Feb 28, 2023):

i know its invalid

Why are you trying to define this property if you know that its name ( brown ) is invalid? And even if you write it in the configuration file, it will simply be ignored, and then, when the file is overwritten, this property will be deleted.

@237dmitry commented on GitHub (Feb 28, 2023): > i know its invalid Why are you trying to define this property if you know that its name ( `brown` ) is invalid? And even if you write it in the configuration file, it will simply be ignored, and then, when the file is overwritten, this property will be deleted.
Author
Owner

@j4james commented on GitHub (Feb 28, 2023):

@Biakiss That's just the way terminals work. There are 16 customizable colors which applications can use if they want their output to match the user's preferred terminal color scheme. However, they can also choose to use explicit RGB values if they want to control the exact look of the application output.

If you don't like the application's choice of colors, you should take that up with the application authors. Although in this particular case, if you're using vim, I believe they already have theme configuration options which should allow you to set the colors exactly how you want them.

@j4james commented on GitHub (Feb 28, 2023): @Biakiss That's just the way terminals work. There are 16 customizable colors which applications can use if they want their output to match the user's preferred terminal color scheme. However, they can also choose to use explicit RGB values if they want to control the exact look of the application output. If you don't like the application's choice of colors, you should take that up with the application authors. Although in this particular case, if you're using vim, I believe they already have theme configuration options which should allow you to set the colors exactly how you want them.
Author
Owner

@zadjii-msft commented on GitHub (Feb 28, 2023):

Yep, j4james hit it on the nose. However your vim colorscheme is defined, it's specifying that "brown" color manually. It's using either a 256-color value or straight up a rgb color, rather than relying on one of the 16 colors of the palette. I'd start by inspecting that vim color scheme, or trying a different one.

@zadjii-msft commented on GitHub (Feb 28, 2023): Yep, j4james hit it on the nose. However your `vim` colorscheme is defined, it's specifying that "brown" color manually. It's using either a 256-color value or straight up a rgb color, rather than relying on one of the 16 colors of the palette. I'd start by inspecting that vim color scheme, or trying a different one.
Author
Owner

@ghost commented on GitHub (Feb 28, 2023):

@Biakiss That's just the way terminals work. There are 16 customizable colors which applications can use if they want their output to match the user's preferred terminal color scheme. However, they can also choose to use explicit RGB values if they want to control the exact look of the application output.

If you don't like the application's choice of colors, you should take that up with the application authors. Although in this particular case, if you're using vim, I believe they already have theme configuration options which should allow you to set the colors exactly how you want them.

Its not like i dont like the application colors i dont like that widows terminal doesnt give me the ability to customize them.

The solution here is simple if i set the background to dark the brown will turn to yellow and i can change the color of settings json.

My question is why does the terminal render a color and then it doesnt give an ability to give it a different hex value.

And this is why the issue is with the terminal itself and not vim.

@ghost commented on GitHub (Feb 28, 2023): > @Biakiss That's just the way terminals work. There are 16 customizable colors which applications can use if they want their output to match the user's preferred terminal color scheme. However, they can also choose to use explicit RGB values if they want to control the exact look of the application output. > > If you don't like the application's choice of colors, you should take that up with the application authors. Although in this particular case, if you're using vim, I believe they already have theme configuration options which should allow you to set the colors exactly how you want them. Its not like i dont like the application colors i dont like that widows terminal doesnt give me the ability to customize them. The solution here is simple if i set the background to dark the brown will turn to yellow and i can change the color of settings json. My question is why does the terminal render a color and then it doesnt give an ability to give it a different hex value. And this is why the issue is with the terminal itself and not vim.
Author
Owner

@zadjii-msft commented on GitHub (Feb 28, 2023):

The solution here is simple if i set the background to dark the brown will turn to yellow and i can change the color of settings json

wait, what?

Can you just share your complete settings.json and whatever vim config you're using?


Colors in CLI applications are a little weird. Either an app can say

  • "I want one of the 16 colors of the color table1 "
  • "I want one of the 256 predefined colors"
  • "I want an RGB color"

Terminal can't change the second two sets of colors. However, the colorScheme in the Terminal controls the appearance of those first 16 colors. Those colors have "names" (brightRed, blue, cyan, etc), but it doesn't matter what the values of those colors are. An app can say "I want red" but you've set your scheme to Batman, and the app will get #e6dc44.

Our assertion that the vim scheme is using one of the 256 colors or an RGB color is due to the fact that the apparent "brown" color doesn't appear in your color scheme anywhere. So vim can't be requesting on of colors 0-16 to get that color.

<aside> perhaps the vim scheme is using the dim attribute?


  1. There's also the background and foreground default colors available to CLI apps, but it's usually easiest to just refer to the 16-color table. ↩︎

@zadjii-msft commented on GitHub (Feb 28, 2023): > The solution here is simple if i set the background to dark the brown will turn to yellow and i can change the color of settings json wait, what? Can you just share your complete settings.json and whatever vim config you're using? <hr> Colors in CLI applications are a little weird. Either an app can say * "I want one of the 16 colors of the color table[^1]" * "I want one of the 256 predefined colors" * "I want an RGB color" Terminal can't change the second two sets of colors. However, the colorScheme in the Terminal controls the appearance of those first 16 colors. Those colors have "names" (brightRed, blue, cyan, etc), but it doesn't matter what the values of those colors are. An app can say "I want _red_" but you've set your scheme to [Batman](https://github.com/mbadolato/iTerm2-Color-Schemes#batman), and the app will get `#e6dc44`. Our assertion that the vim scheme is using one of the 256 colors or an RGB color is due to the fact that the apparent "brown" color _doesn't appear in your color scheme anywhere_. So vim can't be requesting on of colors 0-16 to get that color. \<aside> perhaps the vim scheme is using the dim attribute? [^1]: There's also the `background` and `foreground` default colors available to CLI apps, but it's usually easiest to just refer to the 16-color table.
Author
Owner

@ghost commented on GitHub (Feb 28, 2023):

I guess its easier to show :

when i set the background dark vim uses a different colors, for the "dark" default
image

As you can see if i set the bring yellow to geeen i can force whatever color i want.
image

The issue is that with the default "light" theme this is a brown color, so i expect the windows terminal to either pick once of my colors or not be able to display the color at all.

I dont expect it to be able to render "brown" but not let me change it.

@ghost commented on GitHub (Feb 28, 2023): I guess its easier to show : when i set the background dark vim uses a different colors, for the "dark" default ![image](https://user-images.githubusercontent.com/107933013/221946892-a1f127ef-3e1a-4f0d-8624-58d614f90776.png) As you can see if i set the bring yellow to geeen i can force whatever color i want. ![image](https://user-images.githubusercontent.com/107933013/221947149-7054d15b-c14d-4718-8ffb-c4fec10c28ce.png) The issue is that with the default "light" theme this is a brown color, so i expect the windows terminal to either pick once of my colors or not be able to display the color at all. I dont expect it to be able to render "brown" but not let me change it.
Author
Owner

@ghost commented on GitHub (Feb 28, 2023):

Or what am i saying is I want to use use only the colors I have defined to display everything.

@ghost commented on GitHub (Feb 28, 2023): Or what am i saying is I want to use use only the colors I have defined to display everything.
Author
Owner

@zadjii-msft commented on GitHub (Feb 28, 2023):

If you execute :colo in vim, what does it display as the name of the vim color scheme?

@zadjii-msft commented on GitHub (Feb 28, 2023): If you execute `:colo` in `vim`, what does it display as the name of the vim color scheme?
Author
Owner

@ghost commented on GitHub (Feb 28, 2023):

its default im not setting a color scheme on purpose, so i can use my terminal colors.

@ghost commented on GitHub (Feb 28, 2023): its default im not setting a color scheme on purpose, so i can use my terminal colors.
Author
Owner

@ghost commented on GitHub (Feb 28, 2023):

Again this is not related to vim at all, its about how microsoft terminal renders colors.

@ghost commented on GitHub (Feb 28, 2023): Again this is not related to vim at all, its about how microsoft terminal renders colors.
Author
Owner

@DHowett commented on GitHub (Feb 28, 2023):

Again this is not related to vim at all, its about how microsoft terminal renders colors.


Colors in CLI applications are a little weird. Either an app can say

  • "I want one of the 16 colors of the color table"
  • "I want one of the 256 predefined colors"
  • "I want an RGB color"

Terminal can't change the second two sets of colors.

emphasis mine


We're asking because we want to determine what kind of colors you're reporting that Terminal renders incorrectly.

@DHowett commented on GitHub (Feb 28, 2023): > Again this is not related to vim at all, its about how microsoft terminal renders colors. --- > Colors in CLI applications are a little weird. Either an app can say > * "I want one of the 16 colors of the color table" > * "I want one of the 256 predefined colors" > * "I want an RGB color" > > **Terminal can't change the second two sets of colors.** _emphasis mine_ --- We're asking because we want to determine what kind of colors you're reporting that Terminal renders incorrectly.
Author
Owner

@zadjii-msft commented on GitHub (Feb 28, 2023):

There's also https://askubuntu.com/a/24548

If you are on a light terminal, the default is peachpuff.

If you are on a dark terminal, the default is ron.

You can tell which you have by typing :set background?.

(Vim guesses whether your terminal has a dark or light background based on the value of the TERM environment variable.)

I found this answer by going ":color Tab" and choosing each option, then comparing it to the default.

@zadjii-msft commented on GitHub (Feb 28, 2023): There's also https://askubuntu.com/a/24548 > If you are on a light terminal, the default is `peachpuff`. > > If you are on a dark terminal, the default is `ron`. > > You can tell which you have by typing `:set background?`. > > (Vim guesses whether your terminal has a dark or light background based on the value of the `TERM` environment variable.) > > I found this answer by going "`:color` <kbd>Tab</kbd>" and choosing each option, then comparing it to the default.
Author
Owner

@ghost commented on GitHub (Feb 28, 2023):

image
output of color
highlights
image
light background
image

Here is the hardcoded brown :
https://github.com/vim/vim/blob/master/runtime/syntax/syncolor.vim

@ghost commented on GitHub (Feb 28, 2023): ![image](https://user-images.githubusercontent.com/107933013/221968681-a9812661-e5fd-4e5e-824f-1d544719ecd1.png) output of color highlights ![image](https://user-images.githubusercontent.com/107933013/221968792-0ab6e2c1-aa5f-42c2-9510-f8087e3aa418.png) light background ![image](https://user-images.githubusercontent.com/107933013/221968964-514d941b-e72f-45ce-bc07-6d2495677ede.png) Here is the hardcoded brown : https://github.com/vim/vim/blob/master/runtime/syntax/syncolor.vim
Author
Owner

@zadjii-msft commented on GitHub (Feb 28, 2023):

Huh, look at that. A whole bunch of ctermfg=130 entries, telling vim to tell the Terminal to use color index 130:https://www.ditig.com/256-colors-cheat-sheet

image

@zadjii-msft commented on GitHub (Feb 28, 2023): Huh, look at that. A whole bunch of `ctermfg=130` entries, telling vim to tell the Terminal to use color index 130:https://www.ditig.com/256-colors-cheat-sheet ![image](https://user-images.githubusercontent.com/18356694/221971959-68ad1eb9-1863-477c-9c1e-9528eacc4b2f.png)
Author
Owner

@ghost commented on GitHub (Feb 28, 2023):

i know... the whole point of this thread is to be able override that in the windows terminal... and it cant

@ghost commented on GitHub (Feb 28, 2023): i know... the whole point of this thread is to be able override that in the windows terminal... and it cant
Author
Owner

@zadjii-msft commented on GitHub (Feb 28, 2023):

I'm not sure there's any Terminal emulator out there that lets you reconfigure the 256-color table1 2 . It's fairly standard across all terminal emulators. Typically, the idiomatic solution is to change that scheme in whatever application (in this case, vim) is using that color, rather than to redefine what 130 is. Like, you could just set colo ron in your .vimrc, and not deal with peachpuff at all


  1. inb4 j4james comes at me with th "actually the jlaf-term in 1998 supported a .cgimanifest for redefining the 256 color palette and that's actually still supported by xterm too" 3 ↩︎

  2. Yes, there are VT sequences for setting those table values at runtime, but that's not what we're talking about here ↩︎

  3. /s ↩︎

@zadjii-msft commented on GitHub (Feb 28, 2023): I'm not sure there's _any_ Terminal emulator out there that lets you reconfigure the 256-color table[^1][^2]. It's fairly standard across all terminal emulators. Typically, the idiomatic solution is to _change that scheme_ in whatever application (in this case, vim) is using that color, rather than to redefine what 130 is. Like, you could just set `colo ron` in your `.vimrc`, and not deal with `peachpuff` at all [^1]: inb4 j4james comes at me with th "actually the jlaf-term in 1998 supported a .cgimanifest for redefining the 256 color palette and that's actually still supported by xterm too" [^3] [^2]: Yes, there are VT sequences for setting those table values at runtime, but that's not what we're talking about here [^3]: /s
Author
Owner

@j4james commented on GitHub (Feb 28, 2023):

  1. inb4 j4james comes at me with th "actually the jlaf-term in 1998 supported a .cgimanifest for redefining the 256 color palette

😂 No, I've never seen anything like that. There was a question on StackExchange a few years back asking how to do this in XTerm, and the answer was that you'd need to use escape sequences. If there were any terminals that could do this, I think the two people responding to that SE question would be the ones most likely to have known about it.

@j4james commented on GitHub (Feb 28, 2023): > 1. inb4 j4james comes at me with th "actually the jlaf-term in 1998 supported a .cgimanifest for redefining the 256 color palette 😂 No, I've never seen anything like that. There was a [question on StackExchange](https://unix.stackexchange.com/questions/328752/can-i-change-the-default-palette-for-an-xterm-256color-terminal) a few years back asking how to do this in XTerm, and the answer was that you'd need to use escape sequences. If there were any terminals that could do this, I think the two people responding to that SE question would be the ones most likely to have known about it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19472