In .screenrc, I have this line: term xterm-256color If I do not use that, or if I try something different (like xterm-color or screen-256color), then emacs has absolutely no color.
Here is a font-lock setting in emacs outside screen, displaying everything correctly.
And here are those same settings while inside screen.
The settings for the comment, doc, and preprocessor faces are forced to be inverted background/foreground despite what the settings state.
Here is an example of the atrocious highlighting in action:
How do I fix the colors? Should I cross-post to StackOverflow or Unix StackExchange instead?



TERMenvironment variable? It should be something likexterm-256color.TERMboth outside and inside screen is set to xterm-256color. I confirmed both by usingecho $TERM.screen -c myscreenrc. force screen to use your chosen term withscreen -T xterm-256color. This is really an issue w/ screen's handling of termcap/terminfo. You could work around it by redefining all your colors in emacs, or learning termcap/terminfo and customizing your term setting in your screenrc (man screen, search for "termcapinfo"). I recommend neither. givebyobuortmuxa try. this mess is exactally why i personally switched totmux