Re: [hackers] [st][PATCH] Add support for DSR response "OK" escape sequence

From: Adam Price <komidore64_AT_gmail.com>
Date: Tue, 7 Feb 2023 10:54:57 -0500

On Mon, Feb 6, 2023 at 12:06 PM Roberto E. Vargas Caballero
<k0ga_AT_shike2.com> wrote:
>
> Hi,
>
> On Mon, Feb 06, 2023 at 08:45:27AM +0200, Santtu Lakkala wrote:
> > > tsetattr(csiescseq.arg, csiescseq.narg);
> > > break;
> > > - case 'n': /* DSR – Device Status Report (cursor position) */
> > > - if (csiescseq.arg[0] == 6) {
> > > + case 'n': /* DSR – Device Status Report */
> > > + switch (csiescseq.arg[0]) {
> > > + case 5: /* Status Report "OK" `0n` */
> > > + ttywrite("\033[0n", sizeof("\033[0n"), 0);
> >
> > This will write a NUL byte to the tty, which doesn't seem intentional.
>
> Indeed, but it should not have any difference because '\0' is a control
> character that in this situation is ignored by the terminal. Anyway it
> should be avoided.

Ah right, of course. Thank you to you two for pointing that out. I should use
strlen() instead of sizeof().

I will send an updated patch here shortly.
Received on Tue Feb 07 2023 - 16:54:57 CET

This archive was generated by hypermail 2.3.0 : Tue Feb 07 2023 - 17:00:40 CET