Having some issues with screen. I've been running mutt under screen for a few weeks now (and irssi) which has been working fine but it wasn't until today that I put two and two together, namely that when I cut-n-paste from a terminal with mutt in it, I was getting a lot of whitespace tacked on to the end. This was a big pain for cut-n-paste, say, CVE entries that needed to go into a wiki; all that extra whitespace got tacked on. Well, I stumbled on the fact that if I run mutt outside of screen, this doesn't happen.

So I've spent the last hour googling and trying to find out how to correct this. I suppose it's due to screen running as a vt100 terminal, but I can't figure out a way to tweak it or tell screen to behave, other than to use the "-O" option. If I use "screen -O" then it works fine, but I loose all the color settings in mutt (ie. title bar, status bar, highlight lines that go to the end of the screen). With -O, my top bar is missing, my bottom bar is incomplete, and my highlight lines only highlight the actual text on the line, not to the end of the line.

Aaargh! Essentially, I'm half-way there, but I can't stand such an ugly looking mutt using it that way. Does anyone have any ideas on how to fix this? Right now I'm not going to run mutt under screen, and I'm aliasing "screen" to "screen -O" because that'll prevent me be logged into another system and cut-n-paste from one term to another with a bunch of extra whitespace.

Hmmm... some more playing, now this is interesting.

If I use "screen -S mutt -t mutt -O" then at the shell open mutt, then the cut-n-paste works properly, but mutt is ugly and I miss my status lines, etc. But if I use "screen -S mutt -t mutt -O /sw/bin/mutt" (so it executes mutt directly) then mutt looks fantastic, but cut-n-paste adds all the extra white space. Maybe there's some bad mojo with mutt and screen?

Time to google some more I guess.

UPDATE: well, that was quick. Once I figured out where the issue was coming from, it's definitely a mutt/screen interaction issue and I found the answer in the mutt FAQ. The fix is to add this to ~/.screenrc:

defbce on
term screen-bce

Now I can run mutt in screen, have it look good, and eliminate the whitespace. wOOp!