NetBSD-Bugs archive

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

Re: PR/30978 CVS commit: src/lib/libcurses

Valery Ushakov wrote in <>:
 |The following reply was made to PR lib/30978; it has been noted by GNATS.
 |From: Valery Ushakov <>
 |Subject: Re: PR/30978 CVS commit: src/lib/libcurses
 |Date: Sat, 6 Oct 2018 06:32:00 +0300
 | On Sat, Oct 06, 2018 at 04:19:43 +0300, Valery Ushakov wrote:
 |> As I expected the new curses is broken with TERM=sun.  Emitting that
 |> character into the lower-right corner causes the line to wrap and,
 |> consequenly, the screen contents to scroll up, messing up the display.
 | IIRC the common hack^Wsolution for this is to use insertion, either
 | smir/rmir or ich1 (or ich).

But careful, in my sources i find that cons25 makes problems with
this, so there may be buggy consoles which state they can insert,
but fail to do the right thing nonetheles.

 | E.g. the following will print "AZ" at the lower-right corner on both
 | TERM=vt100 and TERM=sun
 |   tput clear
 |   # this is intended to be in the lower right corner
 |   # but emit it one column before
 |   tput cup $(expr $LINES - 1) $(expr $COLUMNS - 2)
 |   echo -n Z
 |   sleep 5
 |   # re-emit the character that was overwritten by the above
 |   # shifting 'Z' to its target position at the lower right corner
 |   tput cup $(expr $LINES - 1) $(expr $COLUMNS - 2)
 |   tput smir    # enter insert mode - nop is not present
 |   tput ich1    # insert 1 character - nop is not present
 |   echo -n A
 |   tput rmir    # end insert mode - nop is not present
 |   tput cup 0 0
 |   sleep 5
 | Presence of :xn:LP: in termcap just tells you that you can avoid this
 | song and dance and just write to the lower-right corner directly, so
 | it's a micro-optimization and if these capabilities are not present,
 | the display will still be correct at the cost of a few more bytes sent
 | to the terminal.

It is anything but a micro-optimization, really.  Handling of
lowermost-rightmost is a pain for your bu.ho.e.
Ciao, and a nice weekend.

|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

Home | Main Index | Thread Index | Old Index