Re: [dev] [st] XTSMGRAPHICS query

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun, 18 Feb 2024 09:53:26 +0100

On Sat, Feb 17, 2024 at 09:45:44PM -0500, Tim Culverhouse wrote:
> Hello - I am the author of a TUI library and received a bug report regarding
> cursor placement on exiting an application.
>
> I was able to narrow down a simple reproducer to how st a XTSMGRAPHICS query:
>
> echo -e "\x1b[?2;1;0S"
>
> This can also be seen when using a notcurses application which *doesn't* enter
> the altscreen (ie `ncls`). notcurses does the XTSMGRAPHICS query in the alt
> screen (which is also the solution I will be using), but `ncls` uses notcurses
> direct mode, which never enters the alt screen thus this bug appears there as
> well.
>
> I checked the source and it looks like the parser is not checking for a private
> indicator when handling a CSI with final character S. In that case, this query
> gets parsed as a SU sequence. I think that ought be modified to ensure there
> isn't a '?' private indicator in the sequence before handling as SU.
>
> Not much of a C programmer but I could take a shot at this if the solution
> sounds ok.
>
> --
> Tim
>

Hi Tim,

Thanks for the report.

Which TUI library did you write? Some real life programs to test it against
would be useful too.

I'll happily look at your patch when you send one,

-- 
Kind regards,
Hiltjo
Received on Sun Feb 18 2024 - 09:53:26 CET

This archive was generated by hypermail 2.3.0 : Sun Feb 18 2024 - 10:00:09 CET