Translate

Image of Modern Operating Systems (3rd Edition)
Image of Beginning Google Maps API 3
Image of Operating System Concepts
Image of Linux Kernel Development (3rd Edition)

Fedora 18 Supports 256 Color Terminals

You may not be aware of it but currently Linux terminal emulators such as xterm only supports 8 colors while those on Apple’s OS X support 256 colors. Now, beginning with Fedora 18, Fedora will also support 256 colors via the xterm-256color terminfo database entry.

To see how many colors a terminal supports:

$ echo $TERM
xterm-256color
$ tput colors
256


I have never liked the default colors produced by the –color color option to ls and other utilities and, as a result, have normally removed such aliases from my bash startup scripts. Having 32 times more colors available gives me much more flexibility to use more visually appealing colors.

Not all applications and utilities can make use of 256 colors at present. Also, if you ssh to another system from a 256 color terminal, because sshpropagates the TERM environment variable, the other system will have to a xterm-256color terminfo; otherwise you will have a degraded experience. A workaround to address this issue is set the remote system’s TERM environmental variable back to a default such as xterm. This could be done for example by adding the following to your shell startup script on the remote system.

test "SSH_CONNECTION" && export TERM=xterm


Note that virtual terminals in Fedora 18 will not support 256 colors.

Comments are closed.