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

Chris Adams cmadams at
Tue Jun 26 02:56:06 UTC 2012

Once upon a time, Matthew Garrett <mjg59 at> said:
> On Mon, Jun 25, 2012 at 08:47:16PM -0500, Chris Adams wrote:
> > 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?
> The proposal actually handles that by parsing the output of the who 
> command, but I'm not sure I'm morally in favour of that.

That wasn't there when I checked before my email, so I didn't know that.
It sounds like adding one hack on top of another; trying to parse the
output of a command not documented to have a fixed specific format is an
even worse idea IMHO.

The terminal program has very few standard ways to communicate
information to programs running in it:

- the TERM environment variable
- TTY settings (i.e. erase, rows, columns)
- answer-back escape sequences

Trying to use anything outside of that data is a bad idea.  Trying to
divine anything else (or just ignore it and assume you know better) is
bound to fail.

What if another terminal program comes along that only emulates
"traditional" xterm (with only 8 colors)?  How does a profile script
know that everything that says "xterm" can do 256 colors?

Or put it another way: why shouldn't this go in the terminal programs
that support 256 colors?  That way they can be tested, and if any one of
them has a problem, the change can be reverted for just that one (while
the rest that work correctly get the benefit of 256 colors).

I'm also always looking to avoid having more programs automatically run
at the start of a login.  If you've ever had to deal with logging into
an overloaded system, the last thing you want is a profile script doing
"who" and "grep" just to try to override the TERM variable to make it
prettier.  I'd like to see less of that, not more.

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