csh Cannot open /etc/termcap after starting "screen"

Jeremy Chadwick freebsd at jdc.parodius.com
Sun Jun 19 06:21:30 UTC 2011


On Sat, Jun 18, 2011 at 11:37:07PM +0300, Kostik Belousov wrote:
> On Sat, Jun 18, 2011 at 10:14:32PM +0200, Stefan `Sec` Zehl wrote:
> > Hi,
> > 
> > On Thu, Jun 16, 2011 at 13:15 -0700, Jeremy Chadwick wrote:
> > >           Example: run mutt from within GNU screen while connected to
> > > the system with PuTTY, then copy some of the terminal content and paste
> > > it somewhere.  Wow, look at all those extraneous spaces at the end of
> > > lines, which you now gloriously have to manually remove.
> > 
> > While I don't want to stand in the way of your rant, this is actually a
> > bug/problem of mutt. -- mutt is really printing spaces there, so it is
> > (IMHO) correct that copy&paste copies spaces.
> 
> It is the case of the default termcap entry for the screen.
> Try "TERM=screen-bce mutt".

Which is in no way acceptable given these kinds of visual results:

http://www.malkavian.com/~jdc/mutt-screen-bce.png

Though what comes across stdout is a lot more reasonable (no padding):

 35745 mutt     GIO   fd 1 wrote 340 bytes
       0x0000 0d1b 5b33 376d 1b5b 4a1b 5b48 1b5b 3337 6d1b 5b34 346d 1b5b 316d 2d2d 2d4d 7574  |..[37m.[J.[H.[37m.[44m.[1m---Mut|
       0x0020 743a 203d 7370 616d 205b 4d73 6773 3a31 204e 6577 3a31 2032 2e38 4b5d 2d2d 2d28  |t: =spam [Msgs:1 New:1 2.8K]---(|
       0x0040 7468 7265 6164 732f 6461 7465 292d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d  |threads/date)-------------------|
       0x0060 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d  |--------------------------------|
       0x0080 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2861 6c6c 292d 2d2d 1b5b  |----------------------(all)---.[|
       0x00a0 323b 3148 1b5b 3337 6d1b 5b34 366d 2020 2031 204e 202b 2030 362f 3138 2031 363a  |2;1H.[37m.[46m   1 N + 06/18 16:|
       0x00c0 3436 2020 4f72 6465 7220 4e6f 7469 6669 6572 2020 2020 2020 2830 2e34 4b29 205b  |46  Order Notifier      (0.4K) [|
       0x00e0 7370 616d 5d20 4865 6c6c 6f1b 5b4b 0d1b 5b34 3042 1b5b 3337 6d1b 5b34 346d 713a  |spam] Hello.[K..[40B.[37m.[44mq:|
       0x0100 5175 6974 2020 643a 4465 6c20 2075 3a55 6e64 656c 2020 733a 5361 7665 2020 6d3a  |Quit  d:Del  u:Undel  s:Save  m:|
       0x0120 4d61 696c 2020 723a 5265 706c 7920 2067 3a47 726f 7570 2020 3f3a 4865 6c70 1b5b  |Mail  r:Reply  g:Group  ?:Help.[|
       0x0140 4b1b 5b32 3b31 3332 481b 5b33 393b 3439 6d1b 5b6d                                |K.[2;132H.[39;49m.[m|

So what happens if one puts "defbce on" in .screenrc and uses
TERM=screen-bce?  Padded spaces:

 35849 mutt     GIO   fd 1 wrote 495 bytes
       0x0000 1b5b 481b 5b33 376d 1b5b 3434 6d1b 5b31 6d2d 2d2d 4d75 7474 3a20 3d73 7061 6d20  |.[H.[37m.[44m.[1m---Mutt: =spam |
       0x0020 5b4d 7367 733a 3120 4e65 773a 3120 496e 633a 3120 322e 384b 5d2d 2d2d 2874 6872  |[Msgs:1 New:1 Inc:1 2.8K]---(thr|
       0x0040 6561 6473 2f64 6174 6529 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d  |eads/date)----------------------|
       0x0060 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d  |--------------------------------|
       0x0080 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d28 616c 6c29 2d2d 2d1b 5b32 3b31 481b 5b33 376d  |-------------(all)---.[2;1H.[37m|
       0x00a0 1b5b 3436 6d20 2020 3120 4e20 2b20 3036 2f31 3820 3136 3a34 3620 204f 7264 6572  |.[46m   1 N + 06/18 16:46  Order|
       0x00c0 204e 6f74 6966 6965 7220 2020 2020 2028 302e 344b 2920 5b73 7061 6d5d 2048 656c  | Notifier      (0.4K) [spam] Hel|
       0x00e0 6c6f 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020  |lo                              |
       0x0100 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020  |                                |
       0x0120 2020 2020 2020 2020 201b 5b34 323b 3148 1b5b 3337 6d1b 5b34 346d 713a 5175 6974  |         .[42;1H.[37m.[44mq:Quit|
       0x0140 2020 643a 4465 6c20 2075 3a55 6e64 656c 2020 733a 5361 7665 2020 6d3a 4d61 696c  |  d:Del  u:Undel  s:Save  m:Mail|
       0x0160 2020 723a 5265 706c 7920 2067 3a47 726f 7570 2020 3f3a 4865 6c70 2020 2020 2020  |  r:Reply  g:Group  ?:Help      |
       0x0180 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020  |                                |
       0x01a0 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 1b5b  |                              .[|
       0x01c0 3433 3b31 481b 5b6d 1b5b 3337 6d20 2020 2020 2020 2020 2020 2020 2020 2020 201b  |43;1H.[m.[37m                  .|
       0x01e0 5b32 3b31 3332 481b 5b33 396d 1b5b 6d                                            |[2;132H.[39m.[m|

-- 
| Jeremy Chadwick                                jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                   Mountain View, CA, US |
| Making life hard for others since 1977.               PGP 4BD6C0CB |



More information about the freebsd-stable mailing list