GNU bug report logs - #54027
Wishlist: Support full CSI u specification for terminal input

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Alex Hutcheson <alexhutcheson@HIDDEN>; dated Wed, 16 Feb 2022 18:25:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 54027 <at> debbugs.gnu.org:


Received: (at 54027) by debbugs.gnu.org; 28 Feb 2022 12:18:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 28 07:18:07 2022
Received: from localhost ([127.0.0.1]:60338 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nOeyd-0001aQ-EV
	for submit <at> debbugs.gnu.org; Mon, 28 Feb 2022 07:18:07 -0500
Received: from eggs.gnu.org ([209.51.188.92]:36388)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nOeyc-0001a0-AM
 for 54027 <at> debbugs.gnu.org; Mon, 28 Feb 2022 07:18:06 -0500
Received: from [2001:470:142:3::e] (port=38256 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nOeyV-00083c-3k; Mon, 28 Feb 2022 07:17:59 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=7vvFcVgh96/huCsZrjqJ+VYH1By6WDfSLHHmZ8YXsG0=; b=UqINHUQbQFoA
 oSLNv3ndvqsjOGCE1AX+6ghRijFDVQ2msdxmA/QWrW50IViYiMpYoOj0vrmme+1OLOjcP4Yfil78v
 wLJlW1PzItcI7F/La0sqTg8F+xBS9r2QS0u+RbuPIfEWxNxYIzQebTT7hWcj7cmxUF93xjJv1q2Bs
 m71zr512Kn2lsCBsb+C7vlD7RlJp3v9CJ/s8Ey7SGT2S2wRfTntjLUVHumqrhzJ3AEjIywPr6LRR4
 KMrW11D2douAoEt7iZi96vYL5ccmwy1SSSfQ7r0XUWK5Fpc3hM8SBuQK4CxvmiW3CwFfX4d2KHf5B
 ELVkdqPkMmfI050xKDueHA==;
Received: from [87.69.77.57] (port=1351 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nOeyS-0004xB-9n; Mon, 28 Feb 2022 07:17:57 -0500
Date: Mon, 28 Feb 2022 14:17:45 +0200
Message-Id: <831qznnq1i.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <jwvee3nzops.fsf-monnier+emacs@HIDDEN> (message from Stefan
 Monnier on Sun, 27 Feb 2022 22:49:58 -0500)
Subject: Re: bug#54027: Wishlist: Support full CSI u specification for
 terminal input
References: <u49xk0dufz5e.fsf@HIDDEN> <8335kg1srp.fsf@HIDDEN>
 <CACjgaUdAvqGQ8WduurgWKHeGa0PDs=4eNDjN_E7zJvLyAAoHvA@HIDDEN>
 <83mtieoxpj.fsf@HIDDEN>
 <CACjgaUdj-3rsp1o4tj=9oTBHkQHJe7X9a7DUCy4EaXu6PicUXg@HIDDEN>
 <jwvee3nzops.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54027
Cc: alexhutcheson@HIDDEN, 54027 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  54027 <at> debbugs.gnu.org
> Date: Sun, 27 Feb 2022 22:49:58 -0500
> 
> Alex Hutcheson [2022-02-27 13:21:20] wrote:
> >> I think just adding the missing combinations is a better way forward.
> > I think we're in agreement here, I was just suggesting how to add
> > the combinations to xterm.el without introducing a lot of boilerplate
> > code.
> 
> Actually, for `ESC [ 27 ...` the better option is to bind `ESC [ 27` to
> a function that reads the subsequent parameters so it will handle *all*
> cases in one go, as in the barely tested patch below.
> 
> For `ESC [ ... u` it's a bit more tricky because it doesn't have such
> a "clean" prefix (it's distinguished by the final `u` instead), so we'd
> have to rework a lot of the rest of the `ESC [` bindings.
> Maybe not a bad idea, tho.

Thanks, but what is your opinion about which of the combinations we
need to add?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54027; Package emacs. Full text available.

Message received at 54027 <at> debbugs.gnu.org:


Received: (at 54027) by debbugs.gnu.org; 28 Feb 2022 03:50:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 27 22:50:18 2022
Received: from localhost ([127.0.0.1]:59759 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nOX3C-0000Yy-9I
	for submit <at> debbugs.gnu.org; Sun, 27 Feb 2022 22:50:18 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16791)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1nOX3A-0000Yh-4B
 for 54027 <at> debbugs.gnu.org; Sun, 27 Feb 2022 22:50:16 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2CE89805B4;
 Sun, 27 Feb 2022 22:50:10 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 783088001A;
 Sun, 27 Feb 2022 22:50:08 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1646020208;
 bh=PvVOaNbL3oAgJ1NK7OwMdpwIZ1w2yoiMxAhMDI+cHsk=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=Bdpq9MQ7bDBDN2cfWqWPlTRzcDlWer/PkCfzNfWB2x7bi84VQG7Fsl4GLT1jvsTG2
 RcYKRhxfepIsg15VDEx8LdKYhAz4tx30uKW13HMFy0fUsNvusQkC9gnuJHwbgA7++F
 2hOQmd5l9o4om44yAqrqQNh1TNrnm7/mVcqRsD3qUYuCQeiEoJSho4XCEj3cVUEG/w
 kdO5l1hkKmz8FPyvU3QnFKNx8wYZw1K78pJRZ9QTIeVsqzkdmIDkhQJJr6YL7/GBC6
 DxzFn3kDdsIL+U6PrW4bTxEs180wVsjf+VwnaI9KY3RKzgvQqw6o8ofP5Q7J3hmh7x
 jO3b1DAnDTrQQ==
Received: from pastel (unknown [45.72.208.76])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 348D3120EB1;
 Sun, 27 Feb 2022 22:50:08 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Alex Hutcheson <alexhutcheson@HIDDEN>
Subject: Re: bug#54027: Wishlist: Support full CSI u specification for
 terminal input
Message-ID: <jwvee3nzops.fsf-monnier+emacs@HIDDEN>
References: <u49xk0dufz5e.fsf@HIDDEN> <8335kg1srp.fsf@HIDDEN>
 <CACjgaUdAvqGQ8WduurgWKHeGa0PDs=4eNDjN_E7zJvLyAAoHvA@HIDDEN>
 <83mtieoxpj.fsf@HIDDEN>
 <CACjgaUdj-3rsp1o4tj=9oTBHkQHJe7X9a7DUCy4EaXu6PicUXg@HIDDEN>
Date: Sun, 27 Feb 2022 22:49:58 -0500
In-Reply-To: <CACjgaUdj-3rsp1o4tj=9oTBHkQHJe7X9a7DUCy4EaXu6PicUXg@HIDDEN>
 (Alex Hutcheson's message of "Sun, 27 Feb 2022 13:21:20 -0500")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.058 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54027
Cc: Eli Zaretskii <eliz@HIDDEN>, 54027 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Alex Hutcheson [2022-02-27 13:21:20] wrote:
>> I think just adding the missing combinations is a better way forward.
> I think we're in agreement here, I was just suggesting how to add
> the combinations to xterm.el without introducing a lot of boilerplate
> code.

Actually, for `ESC [ 27 ...` the better option is to bind `ESC [ 27` to
a function that reads the subsequent parameters so it will handle *all*
cases in one go, as in the barely tested patch below.

For `ESC [ ... u` it's a bit more tricky because it doesn't have such
a "clean" prefix (it's distinguished by the final `u` instead), so we'd
have to rework a lot of the rest of the `ESC [` bindings.
Maybe not a bad idea, tho.


        Stefan


diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index a7e257f41c5..9bf6a5750b1 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -192,6 +192,41 @@ xterm-rxvt-function-map
     map)
   "Keymap of escape sequences, shared between xterm and rxvt support.")
 
+(defun xterm--read-csi ()
+  ;; Format described in the "Control Sequence Introducer" section:
+  ;; https://en.wikipedia.org/wiki/ANSI_escape_code#CSIsection.
+  (let ((params '())
+        (intermediates '())
+        (final nil))
+    (setq final (read-char))
+    (while (<= #x30 final #x3F)
+      (push final params) ;And read more.
+      (setq final (read-char)))
+    (while (<= #x20 final #x2F)
+      (push final intermediates)
+      (setq final (read-char)))
+    (list (nreverse params) (nreverse intermediates) final)))
+
+(defun xterm--csi-27-modified-keys (&rest _)
+  (pcase-let* ((csi (xterm--read-csi))
+               (`(,params ,intermediates ,final) csi)
+               (tmp nil))
+    (cond
+     ((and (eq final ?~) (null intermediates)
+           (setq tmp (apply #'string params))
+           (string-match "\\([1-9][0-9]*\\);\\([0-9]+\\)" tmp))
+      (let ((modifiers (1- (string-to-number (match-string 1 tmp))))
+            (char (string-to-number (match-string 2 tmp))))
+        (vector
+         (+ char
+            (if (zerop (logand modifiers 1)) 0 ?\S-\0)
+            (if (zerop (logand modifiers 2)) 0 ?\A-\0)
+            (if (zerop (logand modifiers 4)) 0 ?\C-\0)
+            (if (zerop (logand modifiers 8)) 0 ?\M-\0)))))
+     (t
+      (message "Unknown CSI-27 sequence: %S" csi)
+      []))))
+
 (defvar xterm-function-map
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map xterm-rxvt-function-map)
@@ -576,12 +611,12 @@ xterm-function-map
 
                     (6 9   [C-S-tab])
                     (6 13  [C-S-return])))
-      (define-key map
-        (format "\e[27;%d;%d~" (nth 0 bind) (nth 1 bind)) (nth 2 bind))
       ;; For formatOtherKeys=1, the sequence is a bit shorter (bug#13839).
       (define-key map
         (format "\e[%d;%du" (nth 1 bind) (nth 0 bind)) (nth 2 bind)))
 
+    (define-key map "\e[27;" #'xterm--csi-27-modified-keys)
+
     ;; Other versions of xterm might emit these.
     (define-key map "\e[1~" [home])
 





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54027; Package emacs. Full text available.

Message received at 54027 <at> debbugs.gnu.org:


Received: (at 54027) by debbugs.gnu.org; 27 Feb 2022 19:16:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 27 14:16:29 2022
Received: from localhost ([127.0.0.1]:59217 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nOP1x-0004wc-2Z
	for submit <at> debbugs.gnu.org; Sun, 27 Feb 2022 14:16:29 -0500
Received: from eggs.gnu.org ([209.51.188.92]:38120)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nOP1s-0004wN-Qd
 for 54027 <at> debbugs.gnu.org; Sun, 27 Feb 2022 14:16:27 -0500
Received: from [2001:470:142:3::e] (port=54822 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nOP1m-0002go-Tx; Sun, 27 Feb 2022 14:16:18 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Rkz1h3DgbZTXPeqjO1dKITbtDRlNiJx9F+ff7e7pRxo=; b=pb22nqj188di
 JTbTK+XlxKEzlzDs39l0/+eNi+rEubXtq4/AAISJaaMe/RxL6NF5FjINaNnexUp6RR1Kb+cRY1nwm
 ndgU+sD6vxgptxSRUfnOyR4ooB19ybznaRuT64Wp1mkuCoHX96yf67Z06IMQrclr7z8rAbWU4aQUS
 ZsGaUZGL82wHhU+vdJKamg9iQjM2VckwLJRPU4pAJyQvy2+i/4rk6K0ZoL5VbMgzx/E7FhVSMIhBq
 ueomdd+L6Z6keHLpcgfs/W3nWRHYX7BIKBZ0oIFZ8G6Nw9ipA0g03MG/lcEshN9ka4sKY3OahUooE
 0CbccojuvD8wm9IlOAZv3w==;
Received: from [87.69.77.57] (port=1912 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nOP1m-0003jP-Ch; Sun, 27 Feb 2022 14:16:18 -0500
Date: Sun, 27 Feb 2022 21:16:06 +0200
Message-Id: <835yp0nmrt.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alex Hutcheson <alexhutcheson@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <CACjgaUcB0AtzEETZ-b-UfYmK+X9MCyTFhBoY9qjGQR5RR2DFKQ@HIDDEN>
 (message from Alex Hutcheson on Sun, 27 Feb 2022 13:53:56 -0500)
Subject: Re: bug#54027: Wishlist: Support full CSI u specification for
 terminal input
References: <u49xk0dufz5e.fsf@HIDDEN> <8335kg1srp.fsf@HIDDEN>
 <CACjgaUdAvqGQ8WduurgWKHeGa0PDs=4eNDjN_E7zJvLyAAoHvA@HIDDEN>
 <83mtieoxpj.fsf@HIDDEN>
 <CACjgaUdj-3rsp1o4tj=9oTBHkQHJe7X9a7DUCy4EaXu6PicUXg@HIDDEN>
 <837d9gnoig.fsf@HIDDEN>
 <CACjgaUcB0AtzEETZ-b-UfYmK+X9MCyTFhBoY9qjGQR5RR2DFKQ@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54027
Cc: 54027 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Alex Hutcheson <alexhutcheson@HIDDEN>
> Date: Sun, 27 Feb 2022 13:53:56 -0500
> Cc: 54027 <at> debbugs.gnu.org
> 
> My thinking is that it's very low-cost to support all possible encodings, 
> even if it's unlikely that a terminal would actually send them.
> 
> Using your example:
> \e[65;5u
> Would be a valid way to encode C-a according to the spec at 
> http://www.leonerd.org.uk/hacks/fixterms/
> 
> Most terminals will not encode it that way, and will instead send ^A, 
> but it would be nice to support it gracefully if a terminal happens to 
> send C-a encoded that way.
> 
> In addition, the "just support all inputs encoded this way" approach
> seems simpler to understand and maintain than an approach that
> distinguishes between key combinations that have an existing 
> alternative encoding and those that don't.
> The entries in the keymap won't be referenced unless Emacs actually
> receives matching input, so the cost of having entries for additional
> combinations seems fairly minimal.
> 
> Maybe I'm misunderstanding keymap performance or some other
> important parameter, though?

Let's add Stefan to this discussion.

Stefan, any comments or thoughts?

> 
> On Sun, Feb 27, 2022 at 1:38 PM Eli Zaretskii <eliz@HIDDEN> wrote:
> 
>  > From: Alex Hutcheson <alexhutcheson@HIDDEN>
>  > Date: Sun, 27 Feb 2022 13:21:20 -0500
>  > Cc: 54027 <at> debbugs.gnu.org
>  > 
>  > We basically need to support the cross-product of:
>  > modifier combinations x ASCII characters
> 
>  No, AFAIU we only need to support keys+modifiers that are not
>  otherwise supported already.  E.g., C-a is already supported, so we
>  don't need to add it, and similarly many other combinations are
>  already supported.  Or what am I missing?
> 
> -- 
> Alex Hutcheson
> alexhutcheson@HIDDEN




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54027; Package emacs. Full text available.

Message received at 54027 <at> debbugs.gnu.org:


Received: (at 54027) by debbugs.gnu.org; 27 Feb 2022 18:54:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 27 13:54:15 2022
Received: from localhost ([127.0.0.1]:59211 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nOOgR-0004QJ-15
	for submit <at> debbugs.gnu.org; Sun, 27 Feb 2022 13:54:15 -0500
Received: from mail-ua1-f50.google.com ([209.85.222.50]:33725)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alexhutcheson@HIDDEN>) id 1nOOgP-0004Q5-0Q
 for 54027 <at> debbugs.gnu.org; Sun, 27 Feb 2022 13:54:13 -0500
Received: by mail-ua1-f50.google.com with SMTP id 4so5009655uaf.0
 for <54027 <at> debbugs.gnu.org>; Sun, 27 Feb 2022 10:54:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=8LB1oyhhVHTFAKpBIncXWk9fzAbLeQGDW3Fwb5roZWQ=;
 b=GXsEngxlvOeqsS9FLnQup+0790Jw0S3Mx1L3RukTB4L9pHM3Fd1aEqTJL1kYFOrdYZ
 T8iwnvtQNGRQECy3RdlPWaYrfmpzRMBoEBrdXAI85vPt1f3NFQ6WkZ9WVJzwNQtOfDJu
 LX4inUXQZ1FmLAPnYgJ0GrRHTtR75DwfXV4xKJh/5xJguLPCOmgWW1h8FQYF/lpQRbVf
 XfhJYZHp83FncjkTIbesKc/VT9dpH+GgWhCB5RdaSHFnOHVQ4YkzYi5yEafOEf6LSIhT
 4acibPsFGYh0mwiln9rkgSnPv9uFpl8WStenyuEWs6e9ijBNC78UsvVEt9AGTq5YpGRL
 Qmfw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=8LB1oyhhVHTFAKpBIncXWk9fzAbLeQGDW3Fwb5roZWQ=;
 b=ViHguHY8AGAA/NcHNrIPxpYoWzQ6SqsTFe5FeuGMZ9SAaX8FhRzdNOHXuesUekiw6Q
 VeGZMmavYzPuG0teIWlLwKHDvU/KeNf+5TTPBKATOH8B/HKQyLTKOLO5Nb1QgEUhd+6B
 IN4dVNMU3N0Sy3KlDmIu4TbcwzwNho2+zsevGa3W8u9nG6En9QHX65gy5GOrU3Yd4G7d
 NB9JNbyudzMbpCjjrssQeGAcaUodfDecSR4H8aO6mQsJ8ZGvzEtGK2Brl7pnbJIeo+DB
 r7/p/cDRWxq93PEV+IbVALA9NFfVyuFLQWdAIr/2YwcYEKJF16aUJ2CZOgWe7m7oJrEZ
 2bxg==
X-Gm-Message-State: AOAM530yp36q5rprPZCICJ6lyMQBub24NZrol9oOWwHYQX5kKGVLkToJ
 y3Yf5RAHT9FC+ye8yAp3Seag/9PledWh6Wq+wGyi31dkY3Y+JQ==
X-Google-Smtp-Source: ABdhPJwLm3egQjTXDtSdK4gO72Q+16mRNQovwBbMR/At1W+5dPOa0AqqiYdt/YGdbTy8EtN+RDJ3wrsZDdNHwuCXDpM=
X-Received: by 2002:ab0:6989:0:b0:346:b33f:7b94 with SMTP id
 t9-20020ab06989000000b00346b33f7b94mr2810463uaq.5.1645988047180; Sun, 27 Feb
 2022 10:54:07 -0800 (PST)
MIME-Version: 1.0
References: <u49xk0dufz5e.fsf@HIDDEN> <8335kg1srp.fsf@HIDDEN>
 <CACjgaUdAvqGQ8WduurgWKHeGa0PDs=4eNDjN_E7zJvLyAAoHvA@HIDDEN>
 <83mtieoxpj.fsf@HIDDEN>
 <CACjgaUdj-3rsp1o4tj=9oTBHkQHJe7X9a7DUCy4EaXu6PicUXg@HIDDEN>
 <837d9gnoig.fsf@HIDDEN>
In-Reply-To: <837d9gnoig.fsf@HIDDEN>
From: Alex Hutcheson <alexhutcheson@HIDDEN>
Date: Sun, 27 Feb 2022 13:53:56 -0500
Message-ID: <CACjgaUcB0AtzEETZ-b-UfYmK+X9MCyTFhBoY9qjGQR5RR2DFKQ@HIDDEN>
Subject: Re: bug#54027: Wishlist: Support full CSI u specification for
 terminal input
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000dba95805d90474ee"
X-Spam-Score: -8.0 (--------)
X-Debbugs-Envelope-To: 54027
Cc: 54027 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -9.0 (---------)

--000000000000dba95805d90474ee
Content-Type: text/plain; charset="UTF-8"

My thinking is that it's very low-cost to support all possible encodings,
even if it's unlikely that a terminal would actually send them.

Using your example:
\e[65;5u
Would be a valid way to encode C-a according to the spec at
http://www.leonerd.org.uk/hacks/fixterms/

Most terminals will not encode it that way, and will instead send ^A,
but it would be nice to support it gracefully if a terminal happens to
send C-a encoded that way.

In addition, the "just support all inputs encoded this way" approach
seems simpler to understand and maintain than an approach that
distinguishes between key combinations that have an existing
alternative encoding and those that don't.
The entries in the keymap won't be referenced unless Emacs actually
receives matching input, so the cost of having entries for additional
combinations seems fairly minimal.

Maybe I'm misunderstanding keymap performance or some other
important parameter, though?

On Sun, Feb 27, 2022 at 1:38 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Alex Hutcheson <alexhutcheson@HIDDEN>
> > Date: Sun, 27 Feb 2022 13:21:20 -0500
> > Cc: 54027 <at> debbugs.gnu.org
> >
> > We basically need to support the cross-product of:
> > modifier combinations x ASCII characters
>
> No, AFAIU we only need to support keys+modifiers that are not
> otherwise supported already.  E.g., C-a is already supported, so we
> don't need to add it, and similarly many other combinations are
> already supported.  Or what am I missing?
>


-- 
Alex Hutcheson
alexhutcheson@HIDDEN

--000000000000dba95805d90474ee
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">My thinking is that it&#39;s very low-cost to support all =
possible encodings,=C2=A0<div>even if it&#39;s unlikely that a terminal wou=
ld actually send them.</div><div><br></div><div>Using your example:</div><d=
iv>\e[65;5u</div><div>Would be a valid way to encode C-a according to the s=
pec at=C2=A0</div><div><a href=3D"http://www.leonerd.org.uk/hacks/fixterms/=
">http://www.leonerd.org.uk/hacks/fixterms/</a><br></div><div><br></div><di=
v>Most terminals will not encode it that way, and will instead send ^A,=C2=
=A0</div><div>but it would be nice to support it gracefully if a terminal h=
appens to=C2=A0</div><div>send C-a encoded that way.</div><div><br></div><d=
iv>In addition, the &quot;just support all inputs encoded this way&quot; ap=
proach</div><div>seems simpler to understand and maintain than an approach =
that</div><div>distinguishes between key combinations that have an existing=
=C2=A0</div><div>alternative encoding and those that don&#39;t.</div><div>T=
he entries in the keymap won&#39;t be referenced unless Emacs actually</div=
><div>receives matching input, so the cost of having entries for additional=
</div><div>combinations seems fairly minimal.</div><div><br></div><div>Mayb=
e I&#39;m misunderstanding keymap performance or some other</div><div>impor=
tant parameter, though?</div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Sun, Feb 27, 2022 at 1:38 PM Eli Zaretskii=
 &lt;<a href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex">&gt; From: Alex Hutcheson =
&lt;<a href=3D"mailto:alexhutcheson@HIDDEN" target=3D"_blank">alexhutch=
eson@HIDDEN</a>&gt;<br>
&gt; Date: Sun, 27 Feb 2022 13:21:20 -0500<br>
&gt; Cc: <a href=3D"mailto:54027 <at> debbugs.gnu.org" target=3D"_blank">54027@d=
ebbugs.gnu.org</a><br>
&gt; <br>
&gt; We basically need to support the cross-product of:<br>
&gt; modifier combinations x ASCII characters<br>
<br>
No, AFAIU we only need to support keys+modifiers that are not<br>
otherwise supported already.=C2=A0 E.g., C-a is already supported, so we<br=
>
don&#39;t need to add it, and similarly many other combinations are<br>
already supported.=C2=A0 Or what am I missing?<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature"><div dir=3D"ltr">Alex Hutcheson<div><a href=3D"m=
ailto:alexhutcheson@HIDDEN" target=3D"_blank">alexhutcheson@HIDDEN<=
/a></div></div></div>

--000000000000dba95805d90474ee--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54027; Package emacs. Full text available.

Message received at 54027 <at> debbugs.gnu.org:


Received: (at 54027) by debbugs.gnu.org; 27 Feb 2022 18:38:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 27 13:38:52 2022
Received: from localhost ([127.0.0.1]:59198 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nOORY-00042A-3V
	for submit <at> debbugs.gnu.org; Sun, 27 Feb 2022 13:38:52 -0500
Received: from eggs.gnu.org ([209.51.188.92]:58946)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nOORW-00041y-4s
 for 54027 <at> debbugs.gnu.org; Sun, 27 Feb 2022 13:38:50 -0500
Received: from [2001:470:142:3::e] (port=54382 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nOORQ-0006dN-GC; Sun, 27 Feb 2022 13:38:44 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=GCAAaiZ8EysRWQ54F45gXPwT9Cg0dcWSjmrt2tK5GS0=; b=ehYLV4hbWrMy
 WFxqGvBUfJ8Rljs8rk1aOOlyHtnIB/whuLInuhHXCH3MiiHLsEknBBew6cL6fAtHNk5iHMkOljWJE
 Lz9zEMBi3Y61kq+UJOjLC73yd0wggPo9pISBIsjaus49jr9/H1/HLlT8nWBzTcyKld5sEKRwhRJGT
 yyDRSwd8oZGJfz65sXb35OWpsP7HUv0bChSXwhoyG31JtXtL1Xfur+cVnn6Vqcdq2YZ2mwjoolkDI
 XVn02xzbj7rpBzeP87jiKGIrdSeZ2PukuZ5/rJ/qr/XUrg0FerVQr23xGABGOXzCMj1DdVUNL5Gdz
 el85nYoGwm2yNrMACE200Q==;
Received: from [87.69.77.57] (port=3580 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nOORP-00087r-QL; Sun, 27 Feb 2022 13:38:44 -0500
Date: Sun, 27 Feb 2022 20:38:31 +0200
Message-Id: <837d9gnoig.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alex Hutcheson <alexhutcheson@HIDDEN>
In-Reply-To: <CACjgaUdj-3rsp1o4tj=9oTBHkQHJe7X9a7DUCy4EaXu6PicUXg@HIDDEN>
 (message from Alex Hutcheson on Sun, 27 Feb 2022 13:21:20 -0500)
Subject: Re: bug#54027: Wishlist: Support full CSI u specification for
 terminal input
References: <u49xk0dufz5e.fsf@HIDDEN> <8335kg1srp.fsf@HIDDEN>
 <CACjgaUdAvqGQ8WduurgWKHeGa0PDs=4eNDjN_E7zJvLyAAoHvA@HIDDEN>
 <83mtieoxpj.fsf@HIDDEN>
 <CACjgaUdj-3rsp1o4tj=9oTBHkQHJe7X9a7DUCy4EaXu6PicUXg@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54027
Cc: 54027 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Alex Hutcheson <alexhutcheson@HIDDEN>
> Date: Sun, 27 Feb 2022 13:21:20 -0500
> Cc: 54027 <at> debbugs.gnu.org
> 
> We basically need to support the cross-product of:
> modifier combinations x ASCII characters

No, AFAIU we only need to support keys+modifiers that are not
otherwise supported already.  E.g., C-a is already supported, so we
don't need to add it, and similarly many other combinations are
already supported.  Or what am I missing?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54027; Package emacs. Full text available.

Message received at 54027 <at> debbugs.gnu.org:


Received: (at 54027) by debbugs.gnu.org; 27 Feb 2022 18:21:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 27 13:21:39 2022
Received: from localhost ([127.0.0.1]:59181 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nOOAs-0003cu-Ui
	for submit <at> debbugs.gnu.org; Sun, 27 Feb 2022 13:21:39 -0500
Received: from mail-vs1-f44.google.com ([209.85.217.44]:46029)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alexhutcheson@HIDDEN>) id 1nOOAr-0003cb-S7
 for 54027 <at> debbugs.gnu.org; Sun, 27 Feb 2022 13:21:38 -0500
Received: by mail-vs1-f44.google.com with SMTP id e5so10770865vsg.12
 for <54027 <at> debbugs.gnu.org>; Sun, 27 Feb 2022 10:21:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=zbshs/wiq92oPTC1+HkqkpZsQ3kSOMmfoVjaZicEs9k=;
 b=hjuh7ABdA+UABmYmF4WpEVpde6WU9RLGhlJbvka7DSRea2YzlxziFlHpSvi7miA4RA
 5Jzz8XLimqLw7oF9ROMgDQ/p+n8xvvVNebwIanm6/kjTEf9ex22OZdVe/eQTzyF/d0Ml
 eIJGaxnWrRGmpVY12uzhvD8zMRR//VL5w524EzQXLO393yIlG7KjqLxvEbVGHGdABN6V
 zK2vNpI1SqNsrd7RuQf3F0DsdFp990Pp/0Ai9xQ0NyYUYKCx9IzVCxrdiwmANZcEKAlg
 zTayqExDDp94WzRuXzJ66oD5DRjoJw10nnsIy6RdAW84j1b5/QKROL8fkug9JisrHpj7
 Av7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=zbshs/wiq92oPTC1+HkqkpZsQ3kSOMmfoVjaZicEs9k=;
 b=KGcuVDnHcXAwnLjkPqXAaJqYMade12eSeNQWGaYGSyyy+y9UKmdGMBF5SxuGudLh+G
 xmGIO26nDm3pTlPN5x89b6F+C/26i4mtNsgrDx3OjZ/0ZLBcGPyo98MIuHmyJZZ667D6
 HlHa3uMQ+YXkr1K+l5hMG8I0yuwB0MaxMfCi8ual6Lo2CPf2+x6HhxGC5iSuQVjCyAB2
 xIss8DcvA+UQZEgd4koKR0BGCFgpphnaHh8HJiWg4Jqcvx6ZLAyJxlMGczdck3G7fwix
 V+vEujWZ+AYWx/7/EIPgzdthtZ1h93X9gwDJArNxvsGxEXW7a0EQeVpq9wSL8gpi9FJD
 nghg==
X-Gm-Message-State: AOAM533Owp0RqOOZkMNZXjqj327u8HBJjqbcd12Vrc1nDoIGc6CBUGgG
 u1jJjSqPOvTPvAU9CUtJwbOfSvdpkuEnhPDsLJqobzowSewLWg==
X-Google-Smtp-Source: ABdhPJyny3VgtImuKJYuxR+0Gkbwf2YLxi0kb+MyunDho1nGuapW3zgnNFBEyMgO1R/axQbk9TWdcdU5TzcjGQqABoU=
X-Received: by 2002:a05:6102:374e:b0:31e:4fee:3ce7 with SMTP id
 u14-20020a056102374e00b0031e4fee3ce7mr6531073vst.84.1645986091929; Sun, 27
 Feb 2022 10:21:31 -0800 (PST)
MIME-Version: 1.0
References: <u49xk0dufz5e.fsf@HIDDEN> <8335kg1srp.fsf@HIDDEN>
 <CACjgaUdAvqGQ8WduurgWKHeGa0PDs=4eNDjN_E7zJvLyAAoHvA@HIDDEN>
 <83mtieoxpj.fsf@HIDDEN>
In-Reply-To: <83mtieoxpj.fsf@HIDDEN>
From: Alex Hutcheson <alexhutcheson@HIDDEN>
Date: Sun, 27 Feb 2022 13:21:20 -0500
Message-ID: <CACjgaUdj-3rsp1o4tj=9oTBHkQHJe7X9a7DUCy4EaXu6PicUXg@HIDDEN>
Subject: Re: bug#54027: Wishlist: Support full CSI u specification for
 terminal input
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000515dbc05d9040078"
X-Spam-Score: -8.0 (--------)
X-Debbugs-Envelope-To: 54027
Cc: 54027 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -9.0 (---------)

--000000000000515dbc05d9040078
Content-Type: text/plain; charset="UTF-8"

> I think just adding the missing combinations is a better way forward.

I think we're in agreement here, I was just suggesting how to add
the combinations to xterm.el without introducing a lot of boilerplate
code.

We basically need to support the cross-product of:
modifier combinations x ASCII characters

It seems like there are 7 possible modifier combinations:
- Control
- Meta
- Shift
- Control + Meta
- Control + Shift
- Meta + Shift
- Control + Shift + Meta

The code in the StackExchange post (https://emacs.stackexchange.com/a/13957
)
doesn't add support for "Meta + Shift" or plain "Shift", because those
combinations
generally already result in something that doesn't need any special
encoding
(e.g. a capital letter or symbol, possibly preceded by an ESC character if
Meta was
pressed). So we only *really* need to support the encodings for the
remaining 5.
At the same time, it might be reasonable to support the other 2, because
they're
still valid encodings, so a terminal might still end up sending them.

Then we have 95 ASCII characters to support: codes 32 through 126
(inclusive), which
covers all the ASCII alphanumeric and punctuation characters.

So our keymap will end up with 5 x 95 = 475 entries
(or 7 x 95 = 665 if we support Shift and Meta+Shift).

To add these entries to xterm.el, we could either:
1. Add 475 lines to xterm.el, with a hard-coded entry for each combination,
or
2. Add a nested loop of (modifier combinations x ASCII characters) that
  generates those 475 entries at runtime when xterm.el is executed.

If we implement #2, it would actually allow us to reduce the lines of code
in xterm.el,
because we could delete the existing hard-coded entries.

On Sat, Feb 26, 2022 at 3:10 AM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Alex Hutcheson <alexhutcheson@HIDDEN>
> > Date: Tue, 22 Feb 2022 20:07:40 -0500
> > Cc: 54027 <at> debbugs.gnu.org
> >
> > - A detailed overview of the issue from the maintainer of xterm.
> >   This covers both the original "CSI 27" encoding and the newer
> >   "CSI u" encoding:
> https://invisible-island.net/xterm/modified-keys.html
> > - A much briefer summary:
> https://github.com/microsoft/terminal/issues/8719#issuecomment-826528702
> > - The xterm man page (see "formatOtherKeys"):
> https://invisible-island.net/xterm/manpage/xterm.html
> >
> > I also realized that this has actually been discussed in the past,
> > and Emacs actually added support for many CSI u sequences to
> >  xterm.el: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=13839
> >
> > I think the only remaining work is to extend that support to cover
> > all reasonable combinations of modifiers and keys, which is what
> > the code snippet in the StackExchange answer attempts to do.
>
> Right, but I'd rather the additional keys followed the same format as
> in the above-mentioned patch by Stefan, posted in bug#13839, because
> that is what we have in xterm.el nowadays.
>
> > We're currently hard-coding the possible combinations of
> > modifiers and keys that we support:
> > https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/term/xterm.el#n464
> > An alternative approach would be to replace that hard-coded list
> > with a programatically-generated list that includes every combination
> > of modifiers and keys.
>
> I'm not sure I understand how you can programmatically generate a list
> of keys: wouldn't it still involve a manually-maintained list at some
> level?
>
> I think just adding the missing combinations is a better way forward.
>
> Thanks.
>


-- 
Alex Hutcheson
alexhutcheson@HIDDEN

--000000000000515dbc05d9040078
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>&gt; I think just adding the missing combinations is =
a better way forward.</div><div><br></div><div>I think we&#39;re in agreeme=
nt here, I was just suggesting how to add=C2=A0</div><div>the combinations =
to xterm.el without introducing a lot of boilerplate</div><div>code.</div><=
div><br></div>We basically need to support the cross-product of:<div>modifi=
er combinations x ASCII characters</div><div><br></div><div>It seems like t=
here are 7 possible modifier combinations:</div><div>- Control</div><div>- =
Meta</div><div>- Shift</div><div>- Control=C2=A0+ Meta</div><div>- Control=
=C2=A0+ Shift</div><div>- Meta=C2=A0+ Shift</div><div></div><div>- Control=
=C2=A0+ Shift=C2=A0+ Meta</div><div><br></div><div>The code in the StackExc=
hange post (<a href=3D"https://emacs.stackexchange.com/a/13957">https://ema=
cs.stackexchange.com/a/13957</a>)=C2=A0</div><div>doesn&#39;t add support f=
or &quot;Meta=C2=A0+ Shift&quot; or plain &quot;Shift&quot;, because those =
combinations</div><div>generally already=C2=A0result in something that does=
n&#39;t need any special encoding=C2=A0</div><div>(e.g. a capital letter or=
 symbol, possibly preceded by an ESC character if Meta was</div><div>presse=
d). So we only *really* need to support=C2=A0the encodings for the remainin=
g 5.</div><div>At the same time, it might be reasonable to support the othe=
r 2, because they&#39;re</div><div>still valid encodings, so a terminal mig=
ht still end up sending them.</div><div><br></div><div>Then we have 95 ASCI=
I characters to support: codes 32 through 126 (inclusive), which</div><div>=
covers all the ASCII alphanumeric and punctuation characters.</div><div><br=
></div><div>So our keymap will end up with 5 x 95 =3D 475 entries=C2=A0</di=
v><div>(or 7 x 95 =3D 665 if we support Shift and Meta+Shift).</div><div><b=
r></div><div>To add these entries to xterm.el, we could either:</div><div>1=
. Add 475 lines to xterm.el, with a hard-coded entry for each combination, =
or</div><div>2. Add a nested loop of (modifier combinations x ASCII charact=
ers) that=C2=A0</div><div>=C2=A0 generates those 475 entries at runtime whe=
n xterm.el is executed.</div><div><br></div><div>If we implement #2, it wou=
ld actually allow us to reduce the lines of code in xterm.el,</div><div>bec=
ause we could delete the existing hard-coded entries.</div></div><br><div c=
lass=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Feb 26, =
2022 at 3:10 AM Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN">eliz@gnu.=
org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e=
x">&gt; From: Alex Hutcheson &lt;<a href=3D"mailto:alexhutcheson@HIDDEN=
" target=3D"_blank">alexhutcheson@HIDDEN</a>&gt;<br>
&gt; Date: Tue, 22 Feb 2022 20:07:40 -0500<br>
&gt; Cc: <a href=3D"mailto:54027 <at> debbugs.gnu.org" target=3D"_blank">54027@d=
ebbugs.gnu.org</a><br>
&gt; <br>
&gt; - A detailed overview of the issue from the maintainer of xterm. <br>
&gt;=C2=A0 =C2=A0This covers both the original &quot;CSI 27&quot; encoding =
and the newer<br>
&gt;=C2=A0 =C2=A0&quot;CSI u&quot; encoding: <a href=3D"https://invisible-i=
sland.net/xterm/modified-keys.html" rel=3D"noreferrer" target=3D"_blank">ht=
tps://invisible-island.net/xterm/modified-keys.html</a><br>
&gt; - A much briefer summary: <a href=3D"https://github.com/microsoft/term=
inal/issues/8719#issuecomment-826528702" rel=3D"noreferrer" target=3D"_blan=
k">https://github.com/microsoft/terminal/issues/8719#issuecomment-826528702=
</a><br>
&gt; - The xterm man page (see &quot;formatOtherKeys&quot;): <a href=3D"htt=
ps://invisible-island.net/xterm/manpage/xterm.html" rel=3D"noreferrer" targ=
et=3D"_blank">https://invisible-island.net/xterm/manpage/xterm.html</a><br>
&gt; <br>
&gt; I also realized that this has actually been discussed in the past,<br>
&gt; and Emacs actually added support for many CSI u sequences to<br>
&gt;=C2=A0 xterm.el: <a href=3D"https://debbugs.gnu.org/cgi/bugreport.cgi?b=
ug=3D13839" rel=3D"noreferrer" target=3D"_blank">https://debbugs.gnu.org/cg=
i/bugreport.cgi?bug=3D13839</a><br>
&gt; <br>
&gt; I think the only remaining work is to extend that support to cover<br>
&gt; all reasonable combinations of modifiers and keys, which is what<br>
&gt; the code snippet in the StackExchange answer attempts to do.<br>
<br>
Right, but I&#39;d rather the additional keys followed the same format as<b=
r>
in the above-mentioned patch by Stefan, posted in bug#13839, because<br>
that is what we have in xterm.el nowadays.<br>
<br>
&gt; We&#39;re currently hard-coding the possible combinations of <br>
&gt; modifiers and keys that we support:<br>
&gt; <a href=3D"https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/term/=
xterm.el#n464" rel=3D"noreferrer" target=3D"_blank">https://git.savannah.gn=
u.org/cgit/emacs.git/tree/lisp/term/xterm.el#n464</a><br>
&gt; An alternative approach would be to replace that hard-coded list<br>
&gt; with a programatically-generated list that includes every combination =
<br>
&gt; of modifiers and keys.<br>
<br>
I&#39;m not sure I understand how you can programmatically generate a list<=
br>
of keys: wouldn&#39;t it still involve a manually-maintained list at some<b=
r>
level?<br>
<br>
I think just adding the missing combinations is a better way forward.<br>
<br>
Thanks.<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature"><div dir=3D"ltr">Alex Hutcheson<div><a href=3D"m=
ailto:alexhutcheson@HIDDEN" target=3D"_blank">alexhutcheson@HIDDEN<=
/a></div></div></div>

--000000000000515dbc05d9040078--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54027; Package emacs. Full text available.

Message received at 54027 <at> debbugs.gnu.org:


Received: (at 54027) by debbugs.gnu.org; 26 Feb 2022 08:10:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 26 03:10:24 2022
Received: from localhost ([127.0.0.1]:54223 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nNs9n-0003RE-MV
	for submit <at> debbugs.gnu.org; Sat, 26 Feb 2022 03:10:23 -0500
Received: from eggs.gnu.org ([209.51.188.92]:43514)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nNs9l-0003Qk-FE
 for 54027 <at> debbugs.gnu.org; Sat, 26 Feb 2022 03:10:22 -0500
Received: from [2001:470:142:3::e] (port=45094 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nNs9g-0006v6-88; Sat, 26 Feb 2022 03:10:16 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ML75nSUdKAfUZALST+PGXzoIY9ocj72zKPHkVXUxHO4=; b=MPIkD6BkTZe5
 4NMjgoT7cMauXd/J9mVk9uFy6jvdAJgyWp8mRttPRJIsKWeQ7kFCp4UO+goFGpkjfqy0vNtSDhAxn
 pS6SaLOGWsEFA8N3oZ8gjVhsBmjU3S8Yb1RBdZJ2ubsxeOTNaviRHk8WN7UIKMqk5SAOj9hCxgjvl
 gUQjNPSRtEXFxBoFsaVjy9WSSoJkxrwzyLgTchxblML3z8NhTvzDXxtLD+BPVMXptl7SfzAutURnI
 O0hYlAlcqclf/Vcx4fw+MxeGjD6nMsS32D6Co1Qh1Ozm9+AhEjQxB/BKUaNCGWYCi0dm8WHNLoL+D
 voA1+J/P/IwVavC8TgjcvA==;
Received: from [87.69.77.57] (port=2294 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nNs9f-0006sd-MB; Sat, 26 Feb 2022 03:10:16 -0500
Date: Sat, 26 Feb 2022 10:10:00 +0200
Message-Id: <83mtieoxpj.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alex Hutcheson <alexhutcheson@HIDDEN>
In-Reply-To: <CACjgaUdAvqGQ8WduurgWKHeGa0PDs=4eNDjN_E7zJvLyAAoHvA@HIDDEN>
 (message from Alex Hutcheson on Tue, 22 Feb 2022 20:07:40 -0500)
Subject: Re: bug#54027: Wishlist: Support full CSI u specification for
 terminal input
References: <u49xk0dufz5e.fsf@HIDDEN> <8335kg1srp.fsf@HIDDEN>
 <CACjgaUdAvqGQ8WduurgWKHeGa0PDs=4eNDjN_E7zJvLyAAoHvA@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54027
Cc: 54027 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Alex Hutcheson <alexhutcheson@HIDDEN>
> Date: Tue, 22 Feb 2022 20:07:40 -0500
> Cc: 54027 <at> debbugs.gnu.org
> 
> - A detailed overview of the issue from the maintainer of xterm. 
>   This covers both the original "CSI 27" encoding and the newer
>   "CSI u" encoding: https://invisible-island.net/xterm/modified-keys.html
> - A much briefer summary: https://github.com/microsoft/terminal/issues/8719#issuecomment-826528702
> - The xterm man page (see "formatOtherKeys"): https://invisible-island.net/xterm/manpage/xterm.html
> 
> I also realized that this has actually been discussed in the past,
> and Emacs actually added support for many CSI u sequences to
>  xterm.el: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=13839
> 
> I think the only remaining work is to extend that support to cover
> all reasonable combinations of modifiers and keys, which is what
> the code snippet in the StackExchange answer attempts to do.

Right, but I'd rather the additional keys followed the same format as
in the above-mentioned patch by Stefan, posted in bug#13839, because
that is what we have in xterm.el nowadays.

> We're currently hard-coding the possible combinations of 
> modifiers and keys that we support:
> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/term/xterm.el#n464
> An alternative approach would be to replace that hard-coded list
> with a programatically-generated list that includes every combination 
> of modifiers and keys.

I'm not sure I understand how you can programmatically generate a list
of keys: wouldn't it still involve a manually-maintained list at some
level?

I think just adding the missing combinations is a better way forward.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54027; Package emacs. Full text available.

Message received at 54027 <at> debbugs.gnu.org:


Received: (at 54027) by debbugs.gnu.org; 23 Feb 2022 01:08:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 22 20:08:02 2022
Received: from localhost ([127.0.0.1]:43130 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nMg8P-0006Lk-ST
	for submit <at> debbugs.gnu.org; Tue, 22 Feb 2022 20:08:02 -0500
Received: from mail-vk1-f175.google.com ([209.85.221.175]:34407)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alexhutcheson@HIDDEN>) id 1nMg8K-0006L9-RU
 for 54027 <at> debbugs.gnu.org; Tue, 22 Feb 2022 20:08:00 -0500
Received: by mail-vk1-f175.google.com with SMTP id j9so11444248vkj.1
 for <54027 <at> debbugs.gnu.org>; Tue, 22 Feb 2022 17:07:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=76MX1Qj2/FM48wkCpo2J7gAN1LUeDs1pXUfeiykz+T4=;
 b=rfE1PUUmvlbX3MmoQ9PNe0QfPaz6yhlDuTpufbCmMX9gp7J2imAcqAKqwzj9slWd7e
 RDj1Wt5hZ/VHDq6DPb0tadMtmfLqOSSmFndezskQ/LXpM7VnyNgOuaIWOXvC90nH8u+o
 m0CLmVhimmGr+Z7ZPQAfCYrLobp+yo5wscYcMTa0XIqi7piwI7A6c+BGTyxHObSbLRrC
 yAVH645S0mRNLl9pPnD21XHHHQisgLAMdYbxIt9c9l4lqaSNjSQABQBUAlzaL81U1t5Y
 Sswav7pU+55bTW5R/Cq+iaeVh80pObg4kT2uhk/dX5fPBHWn1ZXedgURjQIAnGlQvyw1
 uOGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=76MX1Qj2/FM48wkCpo2J7gAN1LUeDs1pXUfeiykz+T4=;
 b=7gfhKP4oWETOMElzhzkvPnNfjrzvKHIb7K585C0dXMaKKb/t4o3sydOQzXS6QCfH1u
 7aDfpFYAPHIVxL9ULGzrV9kQw0ZTFfwBqCDxwYrLNQTJdRnQ4ZQobKt7VC70lxqjc8TE
 epQpuipj6m/cyyMBz2zD6SXRv68uWiPMa4N40DjF68nZJNxKoeCgUtsMizNd/8C031BJ
 rqHk9bC296/ucAy8k/7ze4sh0TrpAiJ/fPZmFkJbN/Mr8EvpjJpvB60k5l5heb1WQ47v
 lG1jdDpJ/2l71GnwMPjdm7DZbQgSSSNM3HrZYzt0X9NOR29yujG4T7nR2ybLW70laaET
 pfAA==
X-Gm-Message-State: AOAM532dDXXT92H85VSrLyZwxcTodzZPXAoggsU/Euppm9qfWrzyN9Uk
 DLIrveKXCDxoXc7sCdkE7Hh5EDIUNXRez1vvFRwnvc9lyCVPQA==
X-Google-Smtp-Source: ABdhPJwfjecGSV92WjjRXN+K7m7a3C0aJxZDFHkoCg52C2FjBTwjswNf3LRpXvktJClNmXrIcgo1paNrsYYfeVdoWSk=
X-Received: by 2002:a05:6122:7cd:b0:330:c206:d471 with SMTP id
 l13-20020a05612207cd00b00330c206d471mr11037058vkr.11.1645578471221; Tue, 22
 Feb 2022 17:07:51 -0800 (PST)
MIME-Version: 1.0
References: <u49xk0dufz5e.fsf@HIDDEN> <8335kg1srp.fsf@HIDDEN>
In-Reply-To: <8335kg1srp.fsf@HIDDEN>
From: Alex Hutcheson <alexhutcheson@HIDDEN>
Date: Tue, 22 Feb 2022 20:07:40 -0500
Message-ID: <CACjgaUdAvqGQ8WduurgWKHeGa0PDs=4eNDjN_E7zJvLyAAoHvA@HIDDEN>
Subject: Re: bug#54027: Wishlist: Support full CSI u specification for
 terminal input
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000003a9ab305d8a51834"
X-Spam-Score: -8.0 (--------)
X-Debbugs-Envelope-To: 54027
Cc: 54027 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -9.0 (---------)

--0000000000003a9ab305d8a51834
Content-Type: text/plain; charset="UTF-8"

> kitty is a problematic terminal emulator, from the POV of an Emacs

Thanks for the context - I wasn't aware. We can forget about kitty then.

I've done a bit more research and realized that xterm also supports this
encoding. It just requires the formatOtherKeys setting to be enabled.

A couple links I found useful:

- A detailed overview of the issue from the maintainer of xterm.
  This covers both the original "CSI 27" encoding and the newer
  "CSI u" encoding: https://invisible-island.net/xterm/modified-keys.html
- A much briefer summary:
https://github.com/microsoft/terminal/issues/8719#issuecomment-826528702
- The xterm man page (see "formatOtherKeys"):
https://invisible-island.net/xterm/manpage/xterm.html

I also realized that this has actually been discussed in the past,
and Emacs actually added support for many CSI u sequences to
 xterm.el: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=13839

I think the only remaining work is to extend that support to cover
all reasonable combinations of modifiers and keys, which is what
the code snippet in the StackExchange answer attempts to do.

We're currently hard-coding the possible combinations of
modifiers and keys that we support:
https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/term/xterm.el#n464
An alternative approach would be to replace that hard-coded list
with a programatically-generated list that includes every combination
of modifiers and keys.

--0000000000003a9ab305d8a51834
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; kitty is a problematic terminal emulator, from the PO=
V of an Emacs<br><br>Thanks for the context - I wasn&#39;t aware. We can fo=
rget about kitty then.<br><br>I&#39;ve done a bit more research and realize=
d that xterm also supports this<br>encoding. It just requires the=C2=A0<fon=
t face=3D"monospace">formatOtherKeys</font><font face=3D"arial, sans-serif"=
>=C2=A0setting to be enabled.</font><div><font face=3D"arial, sans-serif"><=
br></font></div><div><font face=3D"arial, sans-serif">A couple links I foun=
d useful:</font></div><div><font face=3D"arial, sans-serif"><br></font></di=
v><div><font face=3D"arial, sans-serif">- A detailed overview of the issue =
from the maintainer of xterm.=C2=A0<br>=C2=A0 This covers both the=C2=A0ori=
ginal &quot;CSI 27&quot; encoding and the newer</font></div><div><font face=
=3D"arial, sans-serif">=C2=A0 &quot;CSI u&quot; encoding:=C2=A0</font><a hr=
ef=3D"https://invisible-island.net/xterm/modified-keys.html">https://invisi=
ble-island.net/xterm/modified-keys.html</a></div><div>- A much briefer summ=
ary:=C2=A0<a href=3D"https://github.com/microsoft/terminal/issues/8719#issu=
ecomment-826528702">https://github.com/microsoft/terminal/issues/8719#issue=
comment-826528702</a></div><div>- The xterm man page (see &quot;formatOther=
Keys&quot;):=C2=A0<a href=3D"https://invisible-island.net/xterm/manpage/xte=
rm.html">https://invisible-island.net/xterm/manpage/xterm.html</a></div><di=
v><br></div><div>I also realized that this has actually been discussed in t=
he past,</div><div>and Emacs actually added support for many CSI u sequence=
s to</div><div>=C2=A0xterm.el:=C2=A0<a href=3D"https://debbugs.gnu.org/cgi/=
bugreport.cgi?bug=3D13839">https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D=
13839</a></div><div><br></div><div>I think the only remaining work is to ex=
tend that support to cover</div><div>all reasonable combinations of modifie=
rs and keys, which is what</div><div>the code snippet in the StackExchange =
answer attempts to do.</div><div><br></div><div>We&#39;re currently hard-co=
ding the possible combinations of=C2=A0</div><div>modifiers and keys that w=
e support:</div><div><a href=3D"https://git.savannah.gnu.org/cgit/emacs.git=
/tree/lisp/term/xterm.el#n464">https://git.savannah.gnu.org/cgit/emacs.git/=
tree/lisp/term/xterm.el#n464</a><br></div><div>An alternative approach woul=
d be to replace that hard-coded list</div><div>with a programatically-gener=
ated=C2=A0list that includes every combination=C2=A0</div><div>of modifiers=
 and keys.</div><div><br></div><div><br></div></div>

--0000000000003a9ab305d8a51834--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54027; Package emacs. Full text available.

Message received at 54027 <at> debbugs.gnu.org:


Received: (at 54027) by debbugs.gnu.org; 18 Feb 2022 08:30:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 18 03:30:29 2022
Received: from localhost ([127.0.0.1]:53406 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nKyen-0002pW-Uj
	for submit <at> debbugs.gnu.org; Fri, 18 Feb 2022 03:30:29 -0500
Received: from eggs.gnu.org ([209.51.188.92]:35606)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nKyeh-0002pA-N6
 for 54027 <at> debbugs.gnu.org; Fri, 18 Feb 2022 03:30:23 -0500
Received: from [2001:470:142:3::e] (port=39098 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nKyec-000216-1W; Fri, 18 Feb 2022 03:30:14 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=LRTC4Ue6MIBzjWKxzEQwO9SYTNX355RYp1/QfxwfaR8=; b=PdQtKU18lqZY
 m2c1AByUwnfh3SpRduKdW0QsorbHMjbyw4ODYYo2SUZsCeL/gx/gWcFIqwvsx7GOF8O2wd5jkXaYt
 q6g5SduO14zK4G5+OXD+dqXOgYZDfIzj0OeGZziYl7sYPH8Yg6i0wVsTQBvMyj4rzr85GImiYlYG2
 9w6N5lzd9dz2NXipclVmgfqsg5A/UqvfOHlo1bF+57w47KoexdLffKZG/r6s+IwPqwNk9z56CoIXe
 IpDFC7sOTfHiEXsdQni5Z2h1W2RyV6Kc5Ho/KeUamWz6kQym6kFftqvBwhViVy9T/psxyyfoPHcXz
 Mz0abOpgBZ6FzRyrlbmLpw==;
Received: from [87.69.77.57] (port=4456 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nKyeW-0007Be-Nt; Fri, 18 Feb 2022 03:30:12 -0500
Date: Fri, 18 Feb 2022 10:30:18 +0200
Message-Id: <8335kg1srp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alex Hutcheson <alexhutcheson@HIDDEN>
In-Reply-To: <u49xk0dufz5e.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal
 input
References: <u49xk0dufz5e.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54027
Cc: 54027 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Resent-From: Alex Hutcheson <alexhutcheson@HIDDEN>
> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
> Resent-CC: bug-gnu-emacs@HIDDEN
> Resent-Sender: help-debbugs@HIDDEN
> Date: Wed, 16 Feb 2022 18:24:13 +0000
> From:  Alex Hutcheson via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> CSI u is a mechanism for reporting keystrokes that is more powerful than
> the standard used in Unix.
> 
> The specification is detailed at:
> http://www.leonerd.org.uk/hacks/fixterms/
> 
> The specification is implemented by iTerm2, which is a popular
> GPL-licensed terminal for macOS:
> https://iterm2.com/documentation-csiu.html
> 
> A variant of the specification is implemented by kitty, another
> GPL-licensed terminal on Linux and macOS:
> https://sw.kovidgoyal.net/kitty/keyboard-protocol/#comprehensive-keyboard-handling-in-terminals
> 
> The GPL-licensed mintty terminal for Windows also has support:
> https://github.com/mintty/mintty/wiki/Keycodes
> 
> Emacs contains code in xterm.el that can handle a subset of the possible
> key combinations encoded to this specification, but not all of them.
> For example, iTerm2 is able to send an encoding for Ctrl-Shift-n (aka
> C-N),
> but Emacs is unable to recognized the CSI u encoding for this key
> combination.
> 
> My feature request is to implement full support for the encoding, so
> that users using a supported terminal can send the full range of
> key combinations to an Emacs running in a terminal.
> 
> Additional context: https://emacs.stackexchange.com/a/13957

The SE article says that Emacs already supports the xterm's variant of
the solution to this problem, but not all the sequences are yet in
xterm.el.  So I think a simpler way forward would be to add the
missing sequences to xterm.el.

kitty is a problematic terminal emulator, from the POV of an Emacs
user; see etc/PROBLEMS for the details.  Given its behavior and the
staunch resistance of the developer to make any changes in it, I think
we should discourage Emacs users from using kitty.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54027; Package emacs. Full text available.

Message received at 54027 <at> debbugs.gnu.org:


Received: (at 54027) by debbugs.gnu.org; 17 Feb 2022 23:15:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 17 18:15:09 2022
Received: from localhost ([127.0.0.1]:52960 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nKpzM-0003EE-LF
	for submit <at> debbugs.gnu.org; Thu, 17 Feb 2022 18:15:09 -0500
Received: from eggs.gnu.org ([209.51.188.92]:39940)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1nKpzL-0003Az-1E
 for 54027 <at> debbugs.gnu.org; Thu, 17 Feb 2022 18:15:03 -0500
Received: from [2001:470:142:3::e] (port=60430 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rms@HIDDEN>)
 id 1nKpzF-0007Mg-NO; Thu, 17 Feb 2022 18:14:57 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From:
 mime-version; bh=U2IAesRH1+eXI1Qd7aGa4QKhEN4KwTzJHJbcY86SBX4=; b=HGhAJ2VvCOTT
 SIVxdmve9czkdnOml32mfuiOn2rdeVGz73mgf9Wdg8nZEReLL7ETO89/QHTQ5dTZYAMtAjg1SM5cb
 21NfQbEFEk+qcZzmKfKEnD9qHuk9GIN3AHNwmC/hAX1hGFbwRMsiir+r7jxAJr1DYepNavYurAUzN
 M6DNfXeO+G/rcS7mzlLSqGKG1f3IbJT8ZlQegc3EtvubU0D3ioQHdtMQ0S+WIQQ7oI3xikrQwgvdS
 7D5tNYozeZRa/yOjDc1aZGKcnQO/O5g9xScHO0GiLC0CVn/jGihIkOOm/CLAy1tEM/OYNFNCEnWhR
 bu845ewgnaK6YTvnZUnjFA==;
Received: from rms by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <rms@HIDDEN>)
 id 1nKpzE-0005Pz-I3; Thu, 17 Feb 2022 18:14:56 -0500
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: Alex Hutcheson <alexhutcheson@HIDDEN>
In-Reply-To: <u49xk0dufz5e.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal
 input
References: <u49xk0dufz5e.fsf@HIDDEN>
Message-Id: <E1nKpzE-0005Pz-I3@HIDDEN>
Date: Thu, 17 Feb 2022 18:14:56 -0500
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54027
Cc: 54027 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > The specification is implemented by iTerm2, which is a popular
  > GPL-licensed terminal for macOS:
  > https://iterm2.com/documentation-csiu.html

We shouldn't spend time adding a feature to GNU Emacs
for the sake of running it on MacOS.

  > The GPL-licensed mintty terminal for Windows also has support:
  > https://github.com/mintty/mintty/wiki/Keycodes

Nor Windows.  We should not implement features that are of no use
on the GNU system.

  > A variant of the specification is implemented by kitty, another
  > GPL-licensed terminal on GNU/Linux and macOS:
  > https://sw.kovidgoyal.net/kitty/keyboard-protocol/#comprehensive-keyboard-handling-in-terminals

Since kitty runs on GNU/Linux, maybe it is worth implementing
this variant of the specification, for the sake of kitty.

It's a matter of weighing the work involved (development and
maintenance) against the benefits.

We could wait and see if this protocol catches on, on GNU/Linux.
If it does, it will surely be worthj supporting.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54027; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Feb 2022 18:24:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 16 13:24:35 2022
Received: from localhost ([127.0.0.1]:49407 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nKOyh-0005Xw-6H
	for submit <at> debbugs.gnu.org; Wed, 16 Feb 2022 13:24:35 -0500
Received: from lists.gnu.org ([209.51.188.17]:35246)
 by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from
 <3T0ENYg0KDR44F8RBON6B8MIHAIIAF8.6IG5OA-AHO-8G46MAHO.ILA@HIDDEN>)
 id 1nKOyf-0005Xn-5C
 for submit <at> debbugs.gnu.org; Wed, 16 Feb 2022 13:24:34 -0500
Received: from eggs.gnu.org ([209.51.188.92]:37654)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from
 <3T0ENYg0KDR44F8RBON6B8MIHAIIAF8.6IG5OA-AHO-8G46MAHO.ILA@HIDDEN>)
 id 1nKOye-0006Xe-JJ
 for bug-gnu-emacs@HIDDEN; Wed, 16 Feb 2022 13:24:33 -0500
Received: from [2607:f8b0:4864:20::b49] (port=45592
 helo=mail-yb1-xb49.google.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from
 <3T0ENYg0KDR44F8RBON6B8MIHAIIAF8.6IG5OA-AHO-8G46MAHO.ILA@HIDDEN>)
 id 1nKOyX-00007A-RN
 for bug-gnu-emacs@HIDDEN; Wed, 16 Feb 2022 13:24:27 -0500
Received: by mail-yb1-xb49.google.com with SMTP id
 2-20020a251302000000b006118f867dadso5839544ybt.12
 for <bug-gnu-emacs@HIDDEN>; Wed, 16 Feb 2022 10:24:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112;
 h=date:message-id:mime-version:subject:from:to;
 bh=1j/cnGFqNX4OV3y5nJJRJKr9KW97eV25JX3UDHcCxEw=;
 b=iP/MLbyhJyA45vkhVCPfHHKiiFrfte7s6wGrvjHC6hMw1d/sRrnBEmYL7pKQmsnfwd
 s9BleMtNI1vs7If/NdrIQe8JUSkVC4VXq4hW8kYsx4fibs0uHgxR8NRcNkLuJGHbrN3Z
 81BtxgiIw88ALuv/pRnyT0JfhjkMwjiSw4GIAngYsn98MAMKqr/T64dSwSTSBmmwzB+d
 dGYuZZt/8sxMqbEHoJMRca0c7JCSL4e6dI7ue0ikI6LafyaFuX4JoJm6VZrLAkWx2Rl9
 Asrow8A3FdF0QSpZwwvyU06qWjEgqnYRvmRgG3y8FC2nJa0vLJkCkWNzlG25MSNXKxXt
 e7gQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:date:message-id:mime-version:subject:from:to;
 bh=1j/cnGFqNX4OV3y5nJJRJKr9KW97eV25JX3UDHcCxEw=;
 b=g2bljl696EGSJacJtWDFBtRunKKpmaQNh3HHNd4j695tAPS9FrnoRSWph+EwpojGir
 Bd/5zPv5PF8z+rsRIEm4s99qiuiTPjF3776nzD158icng5f3Bk/PgSAnIThLk8jNBdfn
 ZizqD8D7YgFmQptgPeOK+auwVN/PT94Ypl19xoSY/h09kX6cYCOg6p9hK3IGyrDtXulO
 XeLliuIwF1aiY+R2/RSA9IusBst2/ffLwpS7xtvasrw1cq8sm7ifBClQGS4QNgRJCtuf
 /JSe0wN4dnlH+167wklnBBdqMG5rkmkVFQWyU+Mw2EkUzdvUQRFG7SrRlMyt5fPZut2H
 9Biw==
X-Gm-Message-State: AOAM531UL2JwvEKkwoo4BQPm69KxL6G/86CCQG2khzBh5BizTeMwmmVx
 +Q3Vmj4+SQUuQDFhWTVKyGYmvjmPKZroStr6wN+979/dXBVKGjIUGwqRvHJFI8P1lAg2/EQG9Qb
 /2iXfgU5obo3jBouP6mPGpAHI6Qn8WjzyIGcU2As3wsf5Ut6B9RInaSDI1GSmC9BBDEWrkH/lO3
 nGpYE=
X-Google-Smtp-Source: ABdhPJytkIToDap5xebb4VEH6zfNk5p9bMnMUzqVd4ApNCFuZIFBvlzHVisVQ49wkoo3qRxNR9MCQ2ApNu7hf/DsER1w
X-Received: from alexh.c.googlers.com ([fda3:e722:ac3:cc00:2b:7d90:c0a8:2248])
 (user=alexhutcheson job=sendgmr) by
 2002:a25:bd14:0:b0:61d:87ce:8b6c with
 SMTP id f20-20020a25bd14000000b0061d87ce8b6cmr3284154ybk.690.1645035855608;
 Wed, 16 Feb 2022 10:24:15 -0800 (PST)
Date: Wed, 16 Feb 2022 18:24:13 +0000
Message-Id: <u49xk0dufz5e.fsf@HIDDEN>
Mime-Version: 1.0
Subject: Wishlist: Support full CSI u specification for terminal input
From: Alex Hutcheson <alexhutcheson@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes
X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::b49
 (failed)
Received-SPF: pass client-ip=2607:f8b0:4864:20::b49;
 envelope-from=3T0ENYg0KDR44F8RBON6B8MIHAIIAF8.6IG5OA-AHO-8G46MAHO.ILA@HIDDEN;
 helo=mail-yb1-xb49.google.com
X-Spam_score_int: -77
X-Spam_score: -7.8
X-Spam_bar: -------
X-Spam_report: (-7.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001,
 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 PDS_HP_HELO_NORDNS=0.978, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01,
 USER_IN_DEF_DKIM_WL=-7.5 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

CSI u is a mechanism for reporting keystrokes that is more powerful than
the standard used in Unix.

The specification is detailed at:
http://www.leonerd.org.uk/hacks/fixterms/

The specification is implemented by iTerm2, which is a popular
GPL-licensed terminal for macOS:
https://iterm2.com/documentation-csiu.html

A variant of the specification is implemented by kitty, another
GPL-licensed terminal on Linux and macOS:
https://sw.kovidgoyal.net/kitty/keyboard-protocol/#comprehensive-keyboard-handling-in-terminals

The GPL-licensed mintty terminal for Windows also has support:
https://github.com/mintty/mintty/wiki/Keycodes

Emacs contains code in xterm.el that can handle a subset of the possible
key combinations encoded to this specification, but not all of them.
For example, iTerm2 is able to send an encoding for Ctrl-Shift-n (aka
C-N),
but Emacs is unable to recognized the CSI u encoding for this key
combination.

My feature request is to implement full support for the encoding, so
that users using a supported terminal can send the full range of
key combinations to an Emacs running in a terminal.

Additional context: https://emacs.stackexchange.com/a/13957




Acknowledgement sent to Alex Hutcheson <alexhutcheson@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#54027; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 28 Feb 2022 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.