[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Different behavior in Linux and Mac OS X
From: |
Sebastiano Vigna |
Subject: |
Different behavior in Linux and Mac OS X |
Date: |
Mon, 3 May 2021 00:01:00 +0100 |
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.
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...
Ciao,
seba
- Different behavior in Linux and Mac OS X,
Sebastiano Vigna <=
- Re: Different behavior in Linux and Mac OS X, Thomas Dickey, 2021/05/02
- Re: Different behavior in Linux and Mac OS X, Sebastiano Vigna, 2021/05/05
- Re: Different behavior in Linux and Mac OS X, Thomas Dickey, 2021/05/05
- Re: Different behavior in Linux and Mac OS X, Thomas Dickey, 2021/05/08
- Re: Different behavior in Linux and Mac OS X, Sebastiano Vigna, 2021/05/08
- Re: Different behavior in Linux and Mac OS X, Sebastiano Vigna, 2021/05/08
- Re: Different behavior in Linux and Mac OS X, Sebastiano Vigna, 2021/05/09
- Re: Different behavior in Linux and Mac OS X, Thomas Dickey, 2021/05/09
- Re: Different behavior in Linux and Mac OS X, Sebastiano Vigna, 2021/05/09
- Re: Different behavior in Linux and Mac OS X, Thomas Dickey, 2021/05/09