Sunday, March 27, 2011

Proper color support in lxterminal

I'm currently using lxterminal as my terminal, and there does not seem to be a way to specify the terminal type. "$TERM" is always set to "xterm", which is the default of the underlying libvte. At least on Debian, the terminfo entry for "xterm" only allows for 16 colors.

As a workaround, I added the following to my .bashrc.
# Turn on 256 color support...
if [ "x$TERM" = "xxterm" ]
then
    export TERM="xterm-256color"
fi

With this I can now properly use color-theme in Emacs - before:

... and after:

2 comments:

marinara said...

your tip works on gnome-terminal, but not lxterminal

please see the lubuntu wiki at
https://help.ubuntu.com/community/Lubuntu/Documentation/FAQ/Workarounds

henzenmann said...

Well it definitely works for me with lxterminal on Debian Squeeze.