Re: [dev] [st] XTSMGRAPHICS query
On Sun, 18 Feb 2024 02:54:19 CST, Hiltjo Posthuma wrote: > Hi Tim, > > Thanks for the report. > > Which TUI library did you write? Some real life programs to test it against > would be useful too. The library is https://sr.ht/~rockorager/vaxis. I have already moved all queries in it to the alt screen so this bug does not actually occur in it anymore, but I still thought I should report in the interest of more robust software. Notcurses does perform this query when using `direct mode`. You can observe the bug when using the demo program from the notcurses library `ncls`. It is subtle but you will see blank lines immediately after the prompt before any output (from the scroll up operation). https://notcurses.com/ > I'll happily look at your patch when you send one, Thanks! I will work on one this week. -- Tim
Re: [dev] [st] XTSMGRAPHICS query
On Sun, 18 Feb 2024 00:29:00 CST, Markus Wichmann wrote: > Had to research what this is supposed to do: XTerm replies to it with > the screen size. Except the docs explicitly warn you that it is not > necessarily the screen size. More accurately, it responds with the screen geometry available for sixel graphics. Generally, terminals which don't support sixels will not respond to this query. I think technically terminals could respond with a 0,0 size available for sixels to suggest they aren't supported. However, I have not found any terminal which responds that doesn't support sixels. So for my use case the actual response doesn't matter, just the fact that something was returned. I wouldn't expect st to respond since it does not support sixel graphics. Terminals can also advertise support through the primary device attribute query as well, but not all do. > I wonder why a TUI application needs to know the screen size in pixels. This is useful for graphic sizing. -- Tim
Re: [dev] [st] XTSMGRAPHICS query
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