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: Sun, 2 May 2021 19:53:35 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Mon, May 03, 2021 at 12:01:00AM +0100, Sebastiano Vigna wrote:
> The following program:
> 
> #include <curses.h>
> #include <term.h>
> 
> int main() {
>       tputs(tgoto("\x1b[%i%p1%d;%p2%dH", 1, 1), 1, putchar);
> }
> 
> when compiled under Linux (Fedora 33) with ncurses 6.2, does not output
> anything.  On Mac OS X (11.2.3), using ncurses 6.2 in MacPorts, it outputs
> the required cursor-positioning string.

Offhand, I'd assume that the buffer-change which I made in 2012
is relevant, but in a quick check I see the same behavior with MacPorts
(output) versus my development version (no output).  There's nothing
unusual about the MacPorts build:

https://github.com/macports/macports-ports/blob/master/devel/ncurses/Portfile

and the last time I checked, Fedora 33 uses the same release (not some
interim/development version):

        ncurses-6.2-3.20200222.fc33.x86_64

https://src.fedoraproject.org/rpms/ncurses/blob/rawhide/f/ncurses.spec

However, I also see no output with 6.1.20181023 (Debian 10).

So I'd call this an apparent regression that I'll have to investigate.

> strace/dtruss show that in the first case there is no call to a system output
> function (in the second case, of course, there is).
> 
> In ne (the nice editor) we give the option to use tputs/tgoto without setting
> up a terminal with setupterm(), relying on hardwired ANSI sequences.  I'm
> pretty sure this was working under all platforms, but apparently somewhere in
> the last few years there was a change, either in the library or in the
> packaging by Fedora, that make that stop working on Linux.
> 
> Of course, is setupterm() is called before calling tputs() the output is
> correct even under Linux.
> 
> I don't even know if this is technically a bug of ncurses, but if this rings
> a bell, or anyone can suggest how to determine why the library is behaving in
> a different way, or suggest a workaround that make the program above works
> under Linux, that'd be great...

-- 
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]