1

I see one other Dark blue color...-Q with the same problem:

Instead of two kinds of blue (normal and bright/bold) I have only one, very hard-to-read so-called "bold blue". Normal blue is even worse, almost invisible.

I don't want to change LS_COLORS. I do want directories in blue, but in a brighter one. I don't want them in magenta or green.

In dircolors' output I see dozens of extensions (tar, tgz, mp3) coding for bright red or magenta. And something as fundamental as a directory gets completely lost in it's midnight blue!

It is already set to bright:

`DIR 01;34 # directory`

or with dircolors -b:

  LS_COLORS='...di=01;34...'

In XTerm I can set *VT100*color12: SkyBlue2 in the app-defaults/ file. But for the console? The kernel only gives me 16 predefined ANSI colors!

Do I have to recompile the kernel to change these RGB definitions for the console? This navy blue must be coded somewhere!


/* added after 1st answer */

I tried echo -en "\e]PCrrggbb" as proposed: this works! This is really special - the bracket is the other way round. And "should be OSC" in the man page...thank you!

The link in dirkt's answer also has setvtrgb as a second solution. Number salad, but no escape codes.

Do these two methods amount to the same?

2
  • The man page lacks two line breaks (for ESC ] P and ESC ] R).
    – dirkt
    Oct 7, 2019 at 16:00
  • Note if you're using Windows Terminal none of these changes will apply. You need to change your "Color Scheme" under Settings.
    – Marc
    Dec 17, 2021 at 9:37

2 Answers 2

2

man 4 console_codes says that ESC ] P nrrggbb is an escape sequence to set the RGB value for color n.

This answer shows a small shell script to change all colors, so for color 12 something along the lines of

echo -en "\e]PC7373C9" # blue

(with your desired RGB values, of course) should work.

(Also consider having a look at the gamma values or color characteristics of your monitor that should be present in the EDID, and make sure they get picked up by your driver. This is often the reason standard colors don't "work" on a particular monitor).

3
  • thanks for this surprising solution! I hardly found the place in the man page, and then it didn't work because I used the usual "\e[" CSI. I updated my Q. I will do some tests.
    – user373503
    Oct 7, 2019 at 14:50
  • I tried different settings and brightness/contrast. I does help the blue a bit, but then the other (bold) colors (and white) start to hurt. And if I change that gamma / EDID, would that not affect everything in X also, not just xterm?
    – user373503
    Oct 7, 2019 at 15:01
  • Random settings and brightness/contrast won't help. But if it's an LCD display, the EDID will have color values for all three phosphors. Do something like cat /sys/class/drm/card1-HDMI-A-3/edid | edid-decode (for the correct card and ouput) to check. And X may pick up that, but the framebuffer might not - look at the logs and see if you find something.
    – dirkt
    Oct 7, 2019 at 16:03
1

I admit I had this kind of answer in mind (from that kernel.org parameter list :

  vt.default_blu= [VT]
                        Format: <blue0>,<blue1>,<blue2>,...,<blue15>
                        Change the default blue palette of the console.
                        This is a 16-member array composed of values
                        ranging from 0-255.

I have never tried this. Now I think I never really understood it! I am sure it works. But you don't want to reboot etc. just to find a suitable color palette.

Anyway, the idea and format is similar to my default solution for adjusting the 16 console colors:

setvtrgb

from package "kbd" (which contains also chvt, loadkeys, showkeys...)

With setvtrgb it is (also) a little fight to keep track of colors 1 to 16 and of RGB from 0 to 255, but the effect is immediate and permanent - and for all virtual terminals at once -- "systemwide"

Some users seem to be confused. Help says:

To seed a valid FILE:
   cat /sys/module/vt/parameters/default_{red,grn,blu} > FILE

This one liner has brace expansion for these three sysfs files. You paste it, edit the file, and load it to see what the new color(s) look like. (Make a copy, otherwise you have to reboot to get the default back).

I showed the file yesterday in this LS_COLORS export

Now the solution proposed by dirkt:

echo -en "\e]PCrrggbb"

This is a "special" linux (non-CSI) escape sequence. "C" is hex for #12 (bold blue).

And this setting is per tty -- you can have a different palette on every tty! More than I asked for!


It's not just about the phantom blue directories, and everything blue in vim, down to the blue tilde signs under the last line.

I also reduced the difference between normal (white) and bold white. Man pages are full of both, and for syntax highlighting I use normal white for comments and bold white for code. Now I can read the grey easily, and the white does not hurt (and damage) my eyes.

You must log in to answer this question.