4

I am trying to configure my terminal to make all colors visible against a light background. I am using terminator. There seem to be colors that I cannot set. In the following screenshot, you can see a very light blue and very light green visible in the text: light blue on first line, light green at the end of second line

In the terminator profile options, I cannot find any way to change these colors. You can see in the screenshot below that I have changed all the color values, and none of them are this light blue or green: enter image description here

How can I change these two colors through terminator? Even better, how can I easily implement a color scheme that is safe against light backgrounds?

I do not want to always use a light theme. My work requires me to frequently switch between light and dark themes, so I need a solution that is toggleable.

1
  • In my case I have to configure Fish shell to fix colors, like set fish_color_command 839496 in config.fish – bartolo-otrit Sep 3 '20 at 6:50
3

Traditionally, graphical terminal emulators offered 16 (8 and their bright counterparts) colors – in addition to the default foreground and background colors. These are the ones most applications pick from, and the ones whose exact RGB values are configurable in the dialog you show.

Later this was extended to a 256-color palette (the same 16 + 240 new ones (a 6*6*6 color cube and 24 grayscale values)). These are also configurable, but not via the graphical settings of Terminator. You can alter these values using the OSC 4 escape sequence, e.g. echo -ne '\e]4;16;#123456\e\\' to set palette index 16 to RGB #123456. Verify by echo -e '\e[38:5:16mtest\e[m' which prints "test" in this color. The index goes from 0 to 15 for the legacy values, and from 16 to 255 for the extended ones. (Also note that OSC 4 takes effect retroactively on text already printed using this color palette index, that is, a newly issued OSC 4 with another RGB value recolors the previously printed "test".)

In practice, however, these new 240 colors aren't typically reconfigured, and have the exact same RGB values across most terminal emulators. Probably redefining them isn't the best approach.

Most likely the syntax highlighting of your editor – or wherever you took that screenshot – uses these extended colors, that's how you get that light green. In addition to reconfiguring the 256-color palette, another approach is to modify the syntax highlighting to use different colors, or to avoid using the extended palette. For the latter, exporting TERM=xterm instead of TERM=xterm-256color might be a workaround, as it claims that the terminal only supports 8/16 colors instead of 256, and your editor will probably pick a different color scheme which doesn't use extended colors.

Some terminals, including Terminator also supports direct true colors. If your text editor switches to light green using direct RGB values (without referring to one of the 256 palette colors), there's no other way to change it than change the actual RGB values in the editor's configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.