Terminal.app in Mac OS X Lion has a feature that took a long time to get implemented: 256 color support. The colors work fine. The issue I'm having is that when I run GNU Screen I do not have access to 256 colors. In screen, $TERM is set to "screen".
I've read different things in different places and am very confused. Some of these include:
- GNU Screen must be compiled with color support (How can I tell if OS X's screen was compiled this way?)
- A special terminfo file for screen-256color must be installed. Does OS X have this?
- In .screenrc, term should be set to "screen-256color".
- Certain functions in Emacs must be called for Emacs to be colorful (http://www.emacswiki.org/emacs/GnuScreen#toc6)
I tried variations of these procedures and have been unsuccessful and uncertain of why I have failed. What is the most direct way for me to enable 256 colors in GNU Screen?
Best Answer
By default,
screen
is not aware that it is running in a 256-color-capablexterm
. To make programs inscreen
recognize this feature, you need to set a couple of things in your~/.screenrc
:If this doesn’t work for you, your version of
screen
probably wasn’t compiled with./configure --enable-colors256
. You can check this in the welcome screen when startingscreen
. The default version that comes with OS X doesn’t support 256 colors. You could check out the source and compile your own version, putting the resulting binary in your$PATH
(I put it in~/bin
which I added to my$PATH
):Sources: 1 and 2