Couldn't we enable 256 colors by default on TERM?

Chris Adams cmadams at
Tue Jun 26 01:47:16 UTC 2012

Once upon a time, Matthew Garrett <mjg59 at> said:
> We discussed this in fesco today and had a couple of concerns. The 
> primary one was that handling this in profile seemed a bit fragile. It 
> seems like it would be more "correct" to have the terminals explicitly 
> set xterm-256 themselves if they're capable of it, rather than assuming 
> things about the binaries that a user may have installed. It's a little 
> more work, although not a great deal - by the looks of it vte sets this 
> itself, so a single patch would handle most of the GTK cases.
> Thoughts?

That would make a lot more sense to me - TERM is set by the terminal
program to communicate its functionality to the shell and child
programs.  The shell init (profile) scripts should not change that
because they "know better"; if the terminal supports 256 colors, it
should set an appropriate TERM value to indicate that.

You should basically _never_ override TERM unless you really know what
you are doing.  For example, when SSHing to something with a smaller
terminal info database, you might override TERM with a value known to be
a subset of the current TERM, such as replacing xterm-256color with
xterm.  Otherwise, you should leave it alone.

Trying to do this in profile scripts assumes that you only run local
terminals that come from Fedora and that have been tested.  For example,
if you SSH to a Fedora box from an old xterm that doesn't do 256 colors,
what happens if profile automagically turns xterm into xterm-256color?

Chris Adams <cmadams at>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.

More information about the devel mailing list