When I have a SSH session in GNU Screen to another machine on which I'm also using GNU Screen, 256 colors don't seem to work. The $TERM is still set correctly. However, if I run Vim, the theme does not look correct as it would with only one screen session.
Local machine: 256 colors in VIM okay
Screen session: 256 colors in VIM okay
SSH to remote machine: 256 colors in VIM okay
Screen session on remote machine: 256 colors in VIM _not_ okay
This is probably a bug in
screen
. It has some known funkiness with recursive sessions. Unfortunately the project is pretty stagnant (last version released 3 years ago) and bug fixes and features aren't getting added.Try
tmux
instead. It does basically the same thing but has a lot of the problematic bits fromscreen
smoothed out and is actively maintained and developed.Tmux is indeed the way to go. By the way, I usually solve the color issues in screen/tmux by using aliases:
This way the applications will always display correct colors, if it's not the case then it's a bug and you should check it out with the developers. IIRC the #tmux chan on FreeNode is full of developers and experienced users.