I have to work on systems which display some colors that are hard to read. I ssh into these systems, but don't have management permission to change the colors they display. Is there any way I can override the shade's of colors in my terminal emulater? (I use konsole
)

- 59,188
- 74
- 187
- 252
3 Answers
Each terminal emulator has its own way of setting color shades (or not). Xterm uses X resources, some of the newer emulators have dialog boxes, some have configuration files.
In Konsole, edit the color scheme in your profile (from the menu: “Settings / Edit current profile”, “Appearance” tab, select a color theme and edit it or make a new one).
There is a common control sequence to set the shade associated with a color number from the application: OSC 4 ; c ; spec BEL
where OSC
is ESC ]
, c
is the color number and spec
is a color spec such as #RGB.
printf %b '\e]4;4;#6495ed\a' # set the blue shade to CornflowerBlue
A change by the application is only effective until the next terminal reset. If you use this method (only recommended if your terminal lacks a configuration mechanism), to make the change effectively persistent, append the color configuration escape sequence to your terminal's reset string (termcap: r1
string; terminfo: rs1
string).

- 829,060
-
huh... I always thought color profile just changed like background/cursor/typed text didn't realize it could change other colors. – xenoterracide Apr 07 '11 at 09:50
You can modifiy ~/.Xresources
on the local machine. See this for an example of themed ~/.Xresources

- 3,752
-
The link is now broken and as a result we have no idea what you'd need to change in your
~/Xresource
to make that work... – Alexis Wilke Jun 04 '17 at 19:39 -
I had a similar problem, but not under X-Windows. I have virtual boxes that I use to compile software on versions of the operating system other than the one I'm running. These have the standard "hardware console" and not a X-Terminal.
If found that the following worked for me:
echo -e "\\e]R\\e]PC6495ed"
I found that code sequence in the documentation! (duh!)
http://man7.org/linux/man-pages/man4/console_codes.4.html
Note that the first part \\e]R
is the reset sequence. So it will reset the colors to their defaults.
The second part, \\e]PC6495ed
is what changes the blue color. Two points here:
- The blue color is color number 12 (the C in that string)
- The P stands for Palette
You are limited to the first 16 colors of the basic console in this case.

- 2,857
-
-
Yeah, it looks like the "ESC ] P" sequence is now ignored. It's still in the docs, but that may just be that the docs were not updated properly. – Alexis Wilke Jun 04 '17 at 19:36