Re: -current tmux not handling some terminal ID strings

2020-08-23 Thread Dave Vandervies
Somebody claiming to be Nicholas Marriott wrote:
> Does this fix it?

Yes, this fixes it.


Thanks,
dave

> 
> Index: tty-keys.c
> ===
> RCS file: /cvs/src/usr.bin/tmux/tty-keys.c,v
> retrieving revision 1.140
> diff -u -p -r1.140 tty-keys.c
> --- tty-keys.c6 Jul 2020 07:27:39 -   1.140
> +++ tty-keys.c23 Aug 2020 20:22:28 -
> @@ -1192,7 +1192,10 @@ tty_keys_device_attributes(struct tty *t
>   if (tty->flags & TTY_HAVEDA)
>   return (-1);
>  
> - /* First three bytes are always \033[?. */
> + /*
> +  * First three bytes are always \033[>. Some older Terminal.app
> +  * versions respond as for DA (\033[?) so accept and ignore that.
> +  */
>   if (buf[0] != '\033')
>   return (-1);
>   if (len == 1)
> @@ -1201,7 +1204,7 @@ tty_keys_device_attributes(struct tty *t
>   return (-1);
>   if (len == 2)
>   return (1);
> - if (buf[2] != '>')
> + if (buf[2] != '>' && buf[2] != '?')
>   return (-1);
>   if (len == 3)
>   return (1);
> @@ -1218,6 +1221,10 @@ tty_keys_device_attributes(struct tty *t
>   return (-1);
>   tmp[i] = '\0';
>   *size = 4 + i;
> +
> + /* Ignore DA response. */
> + if (buf[2] == '?')
> + return (0);
>  
>   /* Convert all arguments to numbers. */
>   cp = tmp;
> 
> 

-- 
Dave Vandervies
dj3va...@terse.ca

Plan your future!  Make God laugh!



Re: -current tmux not handling some terminal ID strings

2020-08-23 Thread Nicholas Marriott
Does this fix it?

Index: tty-keys.c
===
RCS file: /cvs/src/usr.bin/tmux/tty-keys.c,v
retrieving revision 1.140
diff -u -p -r1.140 tty-keys.c
--- tty-keys.c  6 Jul 2020 07:27:39 -   1.140
+++ tty-keys.c  23 Aug 2020 20:22:28 -
@@ -1192,7 +1192,10 @@ tty_keys_device_attributes(struct tty *t
if (tty->flags & TTY_HAVEDA)
return (-1);
 
-   /* First three bytes are always \033[?. */
+   /*
+* First three bytes are always \033[>. Some older Terminal.app
+* versions respond as for DA (\033[?) so accept and ignore that.
+*/
if (buf[0] != '\033')
return (-1);
if (len == 1)
@@ -1201,7 +1204,7 @@ tty_keys_device_attributes(struct tty *t
return (-1);
if (len == 2)
return (1);
-   if (buf[2] != '>')
+   if (buf[2] != '>' && buf[2] != '?')
return (-1);
if (len == 3)
return (1);
@@ -1218,6 +1221,10 @@ tty_keys_device_attributes(struct tty *t
return (-1);
tmp[i] = '\0';
*size = 4 + i;
+
+   /* Ignore DA response. */
+   if (buf[2] == '?')
+   return (0);
 
/* Convert all arguments to numbers. */
cp = tmp;


On Sun, Aug 23, 2020 at 12:59:07PM -0400, Dave Vandervies wrote:
> In a remote session from an old MacOS terminal (MacOS 10.10.5, I
> don't have anything newer to try with), when I start a tmux client,
> the terminal sends (apparently in response to a query from tmux)
> '[?1;2c', which is treated as input into whatever it connects
> to.
> On 6.7 I can work around this by running with TERM=vt100, but on
> -current that workaround no longer works.
> 
> 
> dave
> 
> -- 
> Dave Vandervies
> dj3va...@terse.ca
> 
> Plan your future!  Make God laugh!



-current tmux not handling some terminal ID strings

2020-08-23 Thread Dave Vandervies
In a remote session from an old MacOS terminal (MacOS 10.10.5, I
don't have anything newer to try with), when I start a tmux client,
the terminal sends (apparently in response to a query from tmux)
'[?1;2c', which is treated as input into whatever it connects
to.
On 6.7 I can work around this by running with TERM=vt100, but on
-current that workaround no longer works.


dave

-- 
Dave Vandervies
dj3va...@terse.ca

Plan your future!  Make God laugh!