From: Sean Neakums <sneakums@zork.net>
To: Message Of The Day <motd@zork.net>
Subject: [/etc/motd] Mutt, Screen and BCE
Date: Fri, 5 Jul 2002 22:41:54 +0100

You may have noticed that when mutt is run under screen, all of the
lines of the display are padded out to the full width of the terminal
with spaces.  This seems to happen because the screen/ncurses
combination isn't using a facility called "background colour erase".
If your terminal or terminal emulator supports BCE, then you can turn
it on, and lose the spaces... forever!

1. First of all, add this line to your muttrc:

        color normal white default

   The "default" is the important bit; without it, some lines will
   still get padded out to the width of the screen.

2. Add the following to your screenrc:

        defbce on

   This tells screen that the terminal upon which it is running
   supports BCE.

3. When a program is run under screen, it is told of the capabilities
   of the terminal that screen emulates.  screen does this by setting
   the environment variable TERM to "screen".  However, the terminfo
   file that this causes to be loaded does not have an entry for BCE.
   In order for your applications to know what BCE is available, you must
   use the "screen-bce" terminfo file.  You could do this by setting TERM
   yourself, but I prefer this solution:

        $ cd $HOME
        $ mkdir -p .terminfo/s
        $ ln -s /usr/share/terminfo/s/screen-bce .terminfo/s/screen

   Since ~/.terminfo is searched before the system terminfo databases,
   the screen-bce description will be read by ncurses when it looks
   for the screen description.

 From my testing, it looks like you have to totally restart your screen
session for this to take proper effect, but if you're hard-core paster
of mailing-list flotsam like me, you'll find the price a small one to
pay.

	Sean

-- 
 /                          |
[|] Sean Neakums            |  Questions are a burden to others;
[|] <sneakums@zork.net>     |      answers a prison for oneself.
 \                          |






Rick Moen comments:  Instead of using the home-directory terminfo
symlink Sean mentions, I prefer to add the following line to
/etc/screenrc :

   term screen-bce

Next time screen starts, it will lauch each screen session under its
control with $TERM set to "screen-bce" rather than the normal default
value of "screen".  You should make sure, before doing this, that your
system has a terminfo entry to support this terminal type.  It may be
/etc/terminfo/s/screen-bce, or /usr/share/terminfo/s/screen-bce.

In any event, having taken the remedy Sean recommends, with or without
my modification, I suddenly fixed a problem that has been annoying me
for a year or more:  When I run the mutt mailer under screen, and do
X11 copy/paste from its internal text-pager utility (e.g., what is used
by default to display messages, the paste operation picked up
right-padded space characters on every line.  If you've encountered this
extremely annoying glitch, now you have an effective fix for it.

