Skip to content
Jason Charney edited this page Jan 27, 2015 · 5 revisions

By default, just about every terminal that runs bash displays 16 colors, which is really 8 colors (black, red, green, yellow, blue, magenta, cyan, and white) with two shades (dark and light). But terminals have the ability to display more than those 16 colors. In some configurations, you can display 256 colors! (I know. "Ooh! Aah!" especially in 2015 where we have High Definition screens that display millions (maybe billions) of colors and all that "Retinal Display" stuff.) But for a programmer, 256 colors is a big step in making better use of the terminal.

Why 256 colors?

Some software, especially SPF13-Vim needs 256 color support to display properly.

Change your terminal to change how many colors

The default terminal setting ($TERM) is xterm. On some systems the default terminal set to screen which I feel is a reference to GNU Screen which really is not as nice as tmux.

In ~/.bashrc, if we want to use one of the 256color terminals, we need to force the terminal to use something better.

Namely, add this line at the top of ~/.bashrc (but after the header comments), this line.

[[ $TERM == xterm ]] && TERM=xterm-256color

It might be important to brows the directories inside /usr/share/terminfo/ first to see what is available. Check the s/ and x/ (specifically anything starting with xt) directories in that directory.

screen-256color vs. xterm-256color vs. xterm+256color

TODO: Finish this page.

Clone this wiki locally