From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alex Hutcheson via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#54027: Wishlist: Support full CSI u specification for terminal input Date: Tue, 22 Feb 2022 20:07:40 -0500 Message-ID: References: <8335kg1srp.fsf@gnu.org> Reply-To: Alex Hutcheson Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003a9ab305d8a51834" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15822"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54027@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 23 02:09:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nMg9f-0003uj-9R for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Feb 2022 02:09:19 +0100 Original-Received: from localhost ([::1]:57106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMg9d-0007lP-VH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Feb 2022 20:09:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMg9O-0007ja-Hh for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2022 20:09:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMg9O-0001iI-2R for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2022 20:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nMg9N-0006Na-Tg for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2022 20:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alex Hutcheson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Feb 2022 01:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54027 X-GNU-PR-Package: emacs Original-Received: via spool by 54027-submit@debbugs.gnu.org id=B54027.164557848224417 (code B ref 54027); Wed, 23 Feb 2022 01:09:01 +0000 Original-Received: (at 54027) by debbugs.gnu.org; 23 Feb 2022 01:08:02 +0000 Original-Received: from localhost ([127.0.0.1]:43130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMg8P-0006Lk-ST for submit@debbugs.gnu.org; Tue, 22 Feb 2022 20:08:02 -0500 Original-Received: from mail-vk1-f175.google.com ([209.85.221.175]:34407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMg8K-0006L9-RU for 54027@debbugs.gnu.org; Tue, 22 Feb 2022 20:08:00 -0500 Original-Received: by mail-vk1-f175.google.com with SMTP id j9so11444248vkj.1 for <54027@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) In-Reply-To: <8335kg1srp.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:227468 Archived-At: --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
> kitty is a problematic terminal emulator, from the PO= V of an Emacs

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

I've done a bit more research and realize= d that xterm also supports this
encoding. It just requires the=C2=A0formatOtherKeys=C2=A0setting to be enabled.
<= br>
A couple links I foun= d useful:

- A detailed overview of the issue = from the maintainer of xterm.=C2=A0
=C2=A0 This covers both the=C2=A0ori= ginal "CSI 27" encoding and the newer
- The xterm man page (see "formatOther= Keys"):=C2=A0https://invisible-island.net/xterm/manpage/xterm.html

I also realized that this has actually been discussed in t= he past,
and Emacs actually added support for many CSI u sequence= s to

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

We're currently hard-co= ding the possible combinations of=C2=A0
modifiers and keys that w= e support:
An alternative approach woul= d be to replace that hard-coded list
with a programatically-gener= ated=C2=A0list that includes every combination=C2=A0
of modifiers= and keys.


--0000000000003a9ab305d8a51834--