6

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)

xenoterracide
  • 59,188
  • 74
  • 187
  • 252

3 Answers3

4

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).

  • 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
1

You can modifiy ~/.Xresources on the local machine. See this for an example of themed ~/.Xresources

1

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:

  1. The blue color is color number 12 (the C in that string)
  2. The P stands for Palette

You are limited to the first 16 colors of the basic console in this case.

Alexis Wilke
  • 2,857