bug-ncurses
[Top][All Lists]
Advanced

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

Re: Different behavior in Linux and Mac OS X


From: Thomas Dickey
Subject: Re: Different behavior in Linux and Mac OS X
Date: Sat, 8 May 2021 19:22:05 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Wed, May 05, 2021 at 08:33:02PM -0400, Thomas Dickey wrote:
> On Wed, May 05, 2021 at 10:43:42AM +0100, Sebastiano Vigna wrote:
> > 
> > 
> > > On 3 May 2021, at 00:53, Thomas Dickey <dickey@his.com> wrote:
> > > 
> > > So I'd call this an apparent regression that I'll have to investigate.
> > 
> > Please let me know if I can help in any way.
> 
> I believe that I have enough information.
> (I usually work on ncurses on Saturdays).
>  
> > We would like to release ne 3.3.1 and would be nice to have --ansi work
> > again--even a workaround is fine.  Actually, it would be great, as --ansi
> > would work again even with older versions of ncurses (always assuming it's a
> > regression, of course).

I can see the problem (and solution).  The buffer change from 2012 is
part of why it stopped working, but there were changes in May 2000
and June 2015 which combined with this:

+ the May 2000 changes were part of this:
        + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).

+ the June 2015 changes were cleanup for the 2012 buffer-change, eliminating
  a function which changed the output buffering to unbuffered.  The function
  required storing data in the SCREEN; that structure is normally initialized
  by tgetent or setupterm.

tputs uses other SCREEN information (from the terminal database)
to decide how to respond to padding such as $<5> in the string.
If no initialization was done, your example should be okay,
so I'll modify the code to permit that.  The padding
feature won't be fully functional unless initialization was done.

Whether it's a regression is debatable (using tputs/tgoto/tparm without
initializing the terminal database isn't likely to be a documented
feature).

Rechecking the MacPorts - I see that I omitted the -L to get gcc to
link against the MacPorts version.  Accounting for that, there's no
unexplained difference between Linux and MacOS: the latter is using
ncurses 5.7 (which predates all of those changes).

Of course, my change _now_ is a development change, which will take
time to be available everywhere.

To make your program work portably _now_, I'd initialize things, e.g.,
with a call to tgetent or setupterm (the latter, passing the
reference to the error-return code so that failures don't stop
the program).

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]