2

In my work environment I use xterm, and sometimes gnome-terminal. I like gnome terminal, but some of the colors are much harder to read than those of my xterm.

I am wondering

  • why the colors display differently in the two terminals?
  • what configuration file or setting governs these colors?
  • how to copy my xterm colors to be used in gnome-terminal?

If it makes a difference, when I query the $TERM variable, both windows report xterm.

See xterm on the left, and gnome-terminal on the right. Note especially the 4th row, which is yellow on the xterm, and more orange on the gnome-terminal.

enter image description here

1
  • As an aside, you should also try Konsole, see if it works for you. Commented Jul 19, 2012 at 19:06

2 Answers 2

1

Both terminals are pretending to be xterms, which are pretending to be DEC terminals. They both use the same character escape sequences to say "switch to Bold Red" or whatever. But what "Bold Red" looks like is open for interpretation.

You'd probably have to open the preferences for both Terminals, and check the color number values for both, and copy as appropriate. I'm not sure how to dump the colors in XTerm (i'm sure it's compiled in XResources), but at least you could take this sceenshot, open it in an editor, such as Gimp, and see what the colors are. Then change your Gnome terminal colors to match.

1
  • xterm doesn't pretend to be xterm, although it does emulate VT220, etc. For colors, "appres XTerm"might be a place to start. Commented May 3, 2015 at 19:10
2

xterm's colors were likely chosen in the mid-1990s to more or less match the colors seen on an CGA display. The 256- and 88-color palettes were designed by Todd Larason (patch #111) and Stephen Wall (patch #115) in 1999 to provide easily programmed color palettes (and with compatibility of the 8-, 16-color subsets in mind). Aside from some dispute over the shade of blue used, those have been unchanged since then. The extended (beyond 16) colors are preset with compiled-in defaults generated by a script.

Any of the colors can be altered at runtime using control sequences, as well as queried for their values using control sequences. The xterm sources include several sample scripts, including query-color.pl, which shows how to query the colors using OSC 4.

The first 16 colors correspond also to X resources, whose values can be seen in

appres XTerm

Both gnome-terminal and konsole come with some odd color contrasts which can only be explained by having a design committee involved in look-and-feel. Thus, "black" may not actually be black, but a pleasing (sic) shade of gray. Both do allow customization, neither documents the colors used (aside from source-code).

The question about entering color-scheme information into gnome-terminal has been asked before. Here are a few useful links:

As noted here, gnome-terminal stores its settings (including color-schemes) via tools which change from release to release:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .