Gentoo xterm-256color off by default?

Gentoo xterm-256color off by default?Update: It is advisable not to perform this update. For compatibility purposes with other terminal emulators best to leave this setting to eight bit.

I had an intuition that some off the colors in the terminal seemed a bit off. I’m new to this terminal dealie, and aftering discovering that a lot of vim themes looked poor I found out vim was using 8 bit color. I found the vim setting to fix this but it turns out that x term has been set to 8 bit color all along!

Astounded! Flabergasted! Yes I was. This isn’t an Atari!

Anyways, I tracked down a well-read post in the forums that discussed this and now got it set to 256 colors. To fix this:

Test the terminals color bit depth:

tput colors

Now load the 256 palatte into xterm

export TERM=xterm-256color

To keep settings for 256 colors export the xterm 256 color to ~/.bashrc

Is this the Gentoo default? Am I missing anything here that can relate to concerns of bugs?

About Gen2ly

<3's linux

Posted on 2008-02-25, in Gentoo. Bookmark the permalink. 4 Comments.

  1. Ciaran McCreesh

    Setting TERM=xterm-256color by default for xterm means you’ll get breakage when you ssh to systems that don’t have termcap / terminfo entries for it — which is rather a lot of systems. And setting TERM=xterm and setting co=256 for it means you’ll get breakage in terminals that set TERM=xterm but aren’t themselves xterm.

    Unfortunately, the whole situation is immensely screwed up because of os vendors not shipping up to date termcap / terminfo databases and terminals that aren’t xterm pretending to be so.

  2. If you’re looking for a good Windows client that implements xterm 256 color, try AbsoluteTelnet:

    Ciaran is right in that if you set TERM=xterm-256color, other things will break because they won’t recognize this value for TERM. My solution was to create an alias so that only vim would try to use 256 colors. So, I leave TERM=xterm and create this alias for vim:

    alias vi=’vim -T xterm-256color’

    Now, when I type ‘vi ‘ I get a 256 color vim instead.

    As for terminals ‘pretending’ to be something they’re not, this is pretty much par for the course. That’s why they call it ‘terminal emulation’ We’re all trying to emulate in software what was once done in hardware. XTerm itself is a fairly simple emulation of a DEC VT220 with some extra bits added on.

    Some emulations are more *complete* than others, which is why you tend to get different results/features depending on the one you try. Give AbsoluteTelnet a try. You’ll find it’s pretty good!


    Brian Pence
    Celestial Software
    AbsoluteTelnet (for telnet and ssh)

  3. Thanks for the details guys. I didn’t realize that legacy bits of xterm were being used these days. I’ll take these settings off be content just to have functionality. :9)

    Also for anyone concerned, setting “set t_Co=256” in the ~/.vimrc or doing the above suggestion can give vim the ability to display 256 colors.

    I updated the blog.

  1. Pingback: Gnome Panel Font Color Part Deux « Helpful Linux Tidbits

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 58 other followers

%d bloggers like this: