[bug-notifications] [mutt 0003648]: mutt does not work with screen's altscreen because it is compiled with slang instead of ncurses

Mantis Bug Tracker noreply at opencsw.org
Sat Jan 16 14:35:35 CET 2010


A NOTE has been added to this issue. 
====================================================================== 
http://www.opencsw.org/bugtrack/view.php?id=3648 
====================================================================== 
Reported By:                meunier
Assigned To:                
====================================================================== 
Project:                    mutt
Issue ID:                   3648
Category:                   regular use
Reproducibility:            always
Severity:                   block
Priority:                   normal
Status:                     closed
Resolution:                 won't fix
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-04-29 07:59 CEST
Last Modified:              2010-01-16 14:35 CET
====================================================================== 
Summary:                    mutt does not work with screen's altscreen because
it is compiled with slang instead of ncurses
Description: 
/opt/csw/bin/mutt is compiled with slang, not ncurses, while
/opt/csw/bin/screen is compiled with ncurses, not slang.  So if you use
/opt/csw/bin/screen and start /opt/csw/bin/mutt inside it, it looks like
the ncurses library used by screen and the slang library used by mutt fight
each other in a bad way when screen's altscreen feature is enabled.

Here is a way to reproduce the problem:

[after ssh-ing into a Solaris machine from an xterm]
$ export $TERMINFO=/opt/csw/share/terminfo/
$ /opt/csw/bin/infocmp
#       Reconstructed via infocmp from file:
/opt/csw/share/terminfo/x/xterm
[blablabla ... so the correct terminfo database is being used]
$ ls
[blablabla]
$ /opt/csw/bin/emacs
[exit emacs, the screen returns to its previous content, including showing
the output of the previous 'ls' command.  Note: this will not work and the
ouput of the previous 'ls' command will be invisible if your TERMINFO
environment variable is not set correctly]
$ ls
[blablabla]
$ /opt/csw/bin/mutt
[exit mutt, the screen returns to its previous content, including showing
the output of the previous 'ls' command]
$ /opt/csw/bin/screen
[screen is cleared]
$ ls
[blablabla]
$ /opt/csw/bin/emacs
[exit from emacs, the cursor is at the bottom of the xterm and the output
of the previous 'ls' is not visible anymore]
$ ls
[blablabla]
$ /opt/csw/bin/mutt
[exit from mutt, the cursor is at the bottom of the xterm and the output
of the previous 'ls' is not visible anymore]

So far so good.  Emacs and mutt normally use xterm's "alternate screen"
feature which is why the output of the previous 'ls' command is visible in
the xterm once emacs or mutt has exited.  Screen, on the other hand, does
not provide an alternate screen by default, so emacs and mutt just use the
"regular screen" and the output of the previous 'ls' command is then lost
when emacs or mutt exits.

Now type:

Control-A :

to get the interactive prompt from 'screen', then type:

altscreen on

then you should get a 'Will do alternate screen switching' from 'screen'. 
This tells 'screen' that it should provide an alternate screen to
applications like emacs or mutt that normally use xterm's alternate screen
feature.

Now let's try emacs and mutt again:

$ ls
[blablabla]
$ /opt/csw/bin/emacs
[exit emacs, the screen returns to its previous content, including showing
the output of the previous 'ls' command, just as if emacs were run from a
normal shell instead of being run from within 'screen'.  Great, that's what
I want.]
$ ls
[blablabla]
$ /opt/csw/bin/mutt
[oops, watch screen and mutt fight for control of the alternate screen... 
You can try to type a quick random combination of

x

and

Control-A "

to tell mutt to exit and screen to give you a list of virtual screens
(rather than fighting with mutt) but good luck with regaining control of
your window...]

Now, the fact that emacs works fine in combination with screen's altscreen
feature but that mutt does not tells me that the problem is with mutt, not
screen. After investigating a little, I've come to the conclusion that the
problem is not with the code of mutt itself, but with the fact that
/opt/csw/bin/mutt uses slang while /opt/csw/bin/screen uses ncurses. In
fact I have compiled (with gcc) a version of mutt 1.5.19 with ncurses 5.7
which works perfectly well in the examples above.  On the other hand the
same version of mutt 1.5.19 compiled with slang 2.1.4 fails just like
/opt/csw/bin/mutt, flashing the screen and all.  My /opt/csw/bin/mutt uses
slang 1.4.8, not slang 2.1.4, but that doesn't seem to make any difference,
both fail in the same way.

So is there a way to get /opt/csw/bin/screen to be compiled with ncurses
rather than slang, by any chance?

Thanks,


====================================================================== 

---------------------------------------------------------------------- 
 (0007267) skayser (administrator) - 2010-01-16 14:35
 http://www.opencsw.org/bugtrack/view.php?id=3648#c7267 
---------------------------------------------------------------------- 
Dago, I assume by "works better with slang" Phil was referring to
http://www.opencsw.org/bugtrack/view.php?id=2942
"Broken TERM=xterm terminal handling with 1.5.18,REV=2008.11.03?" which I
encountered a couple of months before.

The root cause for this was that our ncurses terminfo contained an entry
for xterm which described the current xterm implementation, not the stock
one shipped with Solaris. You fixed this for good (after chatting with
Thomas Dickey) by shipping the more conservative xterm terminfo entry with
ncurses, remember?

In the meantime Phil simply recompiled mutt against slang which either
works against the stock Solaris terminfo database or has some other means
to determine terminal capabilities (haven't looked into it yet).

Anyway, with our adjusted terminfo database, I don't see any problem at
all with compiling mutt against ncurses now ... apart from Phil's dislike
of ncurses maybe ;P




More information about the bug-notifications mailing list