Re: Mutt with Screen - problems with colors
On 2007-09-06, Eyolf strem <eyolf@xxxxxxxxxxx> wrote:
> Termcap - terminfo - $TERM - xterm-color, xterm-256color,
> screen-256color, screen-256color-bce - phew, my head is swimming, and
> I'm beginning to hate things like 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm
>
> Here's the problem: I want to have the full color palette of
> xterm-256color. Running mutt under xterm with the TERM variable set to
> xterm-256color works fine, but once I run it in a screen session in
> that xterm, the background color is messed up in areas without text,
> such as in the index and the title bar of the pager. Here's a
> screenshot: http://oestrem.com/tmp/mutt.png.
>
> Relevant settings:
> - in zshrc:
> export TERM=xterm-256color
>
> - in .screenrc:
> term screen-256color-bce
> termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
> defbce "on"
>
> - in .muttrc:
> all backgrounds are set to white, except the indicator (yellow), the
> headers (cyan) and the status bar (blue).
>
> In my searces for a solution, I've come across numerous tips about
> termcap/terminfo entries in the screenrc file, and I've tried'em all,
> but with no luck. (Hopefully, I haven't wrecked anything?)
>
> I'd be eternally grateful for some help on this from
> some of you knowledgeable people.
>
> I need mutt, I need screen, and I need nice colors - now, I can only
> have two of the three...
I had a similar problem for a while when I was getting my 16-color
xterm up and running on a number of systems. I think the solution
should be applicable to your case as well, with modifications to
suit. Here are the notes I took at the time.
--------------------------------------------------------------------
Terminfo
--------
See the screen(1) man page. I copied
screen-3.9.11/terminfo/screeninfo.src to screen.xterm-16color.ti and
edited that file to change
colors#8 --> colors#16
pairs#64 --> pairs#256
per the xterm-16color terminfo entries and changed the descriptions to
screen.xterm-16color|VT 100/ANSI X3.64 virtual terminal with 16 colors,
screen-w.xterm-16color|VT 100/ANSI X3.64 virtual terminal with 132 cols and
16 colors,
I then executed
tic screen.xterm-16color.ti
on both Solaris and HP-UX to update the terminfo entries. Now when I
start screen from a color xterm and $TERM is set to xterm-16color,
screen sets the new $TERM to screen.xterm-16color or to
screen-w.xterm-16color and vim sees the correct value of t_Co.
I am assuming that the number of colors matters only to the controlling
xterm and the applications being run in the screen virtual terminals and
not to screen itself. See the screen(1) man page for warnings as well
as other applications of this feature.
Note: The HP-UX tic complained that the names were too long and said it
truncated them to "screen.xterm-1" and "screen-w.xterm" (14
characters--how archaic!), yet the file names appear in $TERMINFO
correctly and seem to work.
--------------------------------------------------------------------
My ~/.screenrc contains only this:
startup_message off
HTH,
Gary