[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

ncurses screen corruption and terminals



On Sun, 12 Jun 2016, Gene Heskett wrote:
> On Sunday 12 June 2016 00:09:54 Joe Pfeiffer wrote:
> > cbannister@slingshot.co.nz writes:
> > > On Sat, Jun 11, 2016 at 10:04:27PM -0500, David Wright wrote:
> > > It seems obvious to me, he's talking about screen corruption.
> > > Gene, Is this when you close it down?
> >
> > He might be, except I've never seen screen corruption when running
> > aptitude.
> 
> And I have never not seen it.  On several different mother boards, and 
> probably 2x the video cards. If there is a difference, I've not a clue.

Screen corruption on ncurses (or, for that matter, slang) applications
are almost always related to your terminal, and how good its terminal
emulation (you know, the _critical_, raison-d'être function of a
terminal program) actually is.  And how high-quality, up-to-date its
terminfo data is (which is just as important as a non-buggy terminal
emulation engine in practice).

ncurses or slang applications, such as "aptitude", will use the terminfo
database to come up with the bitstreams it has to send to the terminal
to paint the screen.  The terminal emulation engine has to process these
properly.  If the app is buggy, or the terminal emulation engine and
terminfo bitstream don't match exactly right (i.e. either is buggy, or
there are any incompatibilities between them), the result is not going
to be correct.

Getting all this to work properly is still is a problem in 2016.  If I
take the words of the xterm and ncurses upstream maintainer at face
value -- which I am inclined to do, because he really knows what he is
talking about although it is certainly possible he might have outdated
information -- none of KDE, GNOME, or Debian is doing it right (I don't
have the time to learn enough about the really low-level details to
verify or act on this information ATM).

I can attest that Debian jessie's Konsole doesn't work quite right in
every situation with the "TERM=xterm" and Debian's terminfo, for
example.


If you want to peek at the mess, read this:
http://invisible-island.net/ncurses/ncurses.faq.html#which_terminfo

and this:
http://invisible-island.net/xterm/

this is enlightening:
http://invisible-island.net/xterm/xterm.faq.html

and so is this:
https://bugs.kde.org/show_bug.cgi?id=145977


Not to pick on KDE's Konsole terminal emulator, either: Gnome's is not
supposed to be any better from the information in the pages above.

Fixing it is not easy, either, due to the way terminal emulator +
terminfo (which is *local* to the remote system when using a remote
terminal) works.  Including what happens when the remote system does NOT
have a terminal entry for, e.g. TERM=xterm-debian-fix01 :-)

As for "mc", apparently it is a special beast in its own right and it is
part of the problem: supposedly, it has so many workarounds for broken
terminals and terminfo that said workarounds get in the way of fixing
things properly.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh


Reply to: