By default, screen
is not aware that it is running in a 256-color-capable xterm
. To make programs in screen
recognize this feature, you need to set a couple of things in your ~/.screenrc
:
term "screen-256color"
# terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# erase background with current bg color
defbce "on"
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 starting screen
. 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
):
git clone git://git.savannah.gnu.org/screen.git
cd screen/src
./autogen.sh
./configure --enable-colors256
make # I got a lot of warnings here, but they don't seem to matter
sudo make install
cp screen ~/bin/screen
Sources: 1 and 2
Best Answer
If you can create or find an appropriatey inverted ICC profile, this can be used to invert your colours.
See White on black without inverting colors? for more about how the display's colours can be manipulated.