Tigraine

Daniel Hoelbling talks about programming

RSS Feed

Make GNU screen xterm-256color work on OSX

3 Comments
Posted by Daniel Hölbling on January 25, 2012 at 22:26

I just ran into this and spend like 2 hours with Linux genius Jam trying to figure out why in the heck I could run Vim in 256 colors mode on my server while once I started screen it didn’t work any more.

The issue was two fold. a) My local Terminal.app was reporting itself as xterm-color instead of xterm-256color. You have to update this setting in your Terminal app here:

 

Once done you only need to edit your .screenrc to include the following 3 lines:

 

# 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"
# set TERM
term screen-256color-bce

Problem is: Even if you set your .screenrc correctly, it won’t matter if your terminal is not reporting the correct version string in the first place..

Filed under Tools
You can leave a comment, or trackback from your own site.
  • jam

    setting the terminal string for xterm (linux, xserver) can be done by xresources (e.g. ~/.Xresources):
    xterm*termName: xterm-256color

  • Guest

    I’m running Max OSX 10.6.8 Snow Leopard. There is no terminal option for xterm-256color. I guess you are running Lion?

  • http://www.tigraine.at Daniel Hölbling

    Yes I was running Lion.. 

    But I also switched to using Tmux now instead of screen because the default screen that comes with OSX is not capable of running scrren-256color

Projects

dynamic css for .NET