[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, 9 May 2021 06:41:22 -0400 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Sun, May 09, 2021 at 10:01:07AM +0100, Sebastiano Vigna wrote:
>
>
> > On 9 May 2021, at 03:34, Sebastiano Vigna <sebastiano.vigna@unimi.it> wrote:
> >
> >
> >
> >> On 9 May 2021, at 03:20, Sebastiano Vigna <sebastiano.vigna@unimi.it>
> >> wrote:
> >>
> >> No, that's the first thing I tried. It almost works, but not completely.
> >> The cursor is not always positioned correctly. There is some visible
> >> improvement from the no-setupterm() version, but still it does not work.
> >
> > Let me be more precise:
> >
> > - If I unset TERM, the behavior is identical to not calling setupterm()
> > - If I set TERM to "dummy" , the behavior is identical to not calling
> > setupterm()
> > - If I set TERM to "ansi", or leave it xterm-256color, some cursor
> > placement happens but, for example, when moving around the update of line
> > and column numbers happen in the middle of the screen, instead of the
> > status bar.
>
> Got it: if I call tgetent()/setupterm(), tgoto() works, but the parameters
> row,col are exchanged in Linux vs. Mac OS X. If I manually fix the code
> everything works (but then not on Mac OS X). Note that TERM=xterm-256color
> in both cases.
I don't see that difference, testing on each platform, and assuming that
you are still referring to the hard-coded example.
I clarified this detail in the manpage (March 2016):
• While tgoto is assumed to be used for the two-parameter cursor po‐
sitioning capability, termcap applications also use it for single-
parameter capabilities.
Doing this shows a quirk in tgoto: most hardware terminals use cur‐
sor addressing with row first, but the original developers of the
termcap interface chose to put the column parameter first. The
tgoto function swaps the order of parameters. It does this also
for calls requiring only a single parameter. In that case, the
first parameter is merely a placeholder.
>
> In any case, this does not work around the problem because I need the --ansi
> option to work even if the terminfo database is somehow broken. And calling
> tgetent()/setupterm() won't work with a non-existing terminal (in the sense
> that it does not set up anything).
I'd just use TERM=vt100 (and if you have any terminal database, I'd
assume that "vt100" was there).
> Is there some way I can test the fixes? I'm OK even without a workaround if
> I know that in the future everything will work...
>
> Ciao,
>
> seba
>
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: PGP signature
- Different behavior in Linux and Mac OS X, Sebastiano Vigna, 2021/05/02
- 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 <=
- 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