bug-ncurses
[Top][All Lists]
Advanced

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

Re: Using ncurses only for terminfo (no I/O)


From: Thomas Dickey
Subject: Re: Using ncurses only for terminfo (no I/O)
Date: Tue, 19 Jan 2021 04:02:31 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Tue, Jan 19, 2021 at 06:35:11AM +0000, Nicholas Marriott wrote:
> On Mon, Jan 18, 2021 at 05:57:48PM -0000, Grant Edwards wrote:
> > On 2021-01-18, Nicholas Marriott <nicholas.marriott@gmail.com> wrote:
> > 
> > > tmux has been stripping padding from the result of tiget*() and writing
> > > it itself for 10 years now and I have had no problems reported
> > > whatsoever.
> > 
> > That's what my code currently does. One thing I'm wondering about is
> > what happens when a terminal control sequence contains a string like
> > $<5> that looks like a delay specification? Is that escaped somehow in
> > the database and then unescaped by putp() or tputs() when the padding
> > is added?
> 
> I don't know of any sequences which actually needs to output $<. Padding
> is stripped before expansion by tparm so I expect the $ could be
> replaced by %'$' or some other sequence.

hmm - man terminfo(5) shows this:
 
       %'c' char constant c

but that is processed by tparm, leaving only the character constant.

That discussion last summer is the only time that I recall the issue
of $<5> being embedded and stripped/processed by tputs.  Apparently
it's a rare occurrence, which could be worked-around by splitting up
the string into chunks, e.g.,
        tputs("$");
        tputs("<5>");

Florian's example was based on string substitution, which isn't used much.
Aside from documenting this in the manual page, I don't see a need for
additional changes in ncurses, unless there's a demonstrated need.

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