From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 16 13:24:35 2022 Received: (at submit) by debbugs.gnu.org; 16 Feb 2022 18:24:35 +0000 Received: from localhost ([127.0.0.1]:49407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKOyh-0005Xw-6H for submit@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@flex--alexhutcheson.bounces.google.com>) id 1nKOyf-0005Xn-5C for submit@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@flex--alexhutcheson.bounces.google.com>) id 1nKOye-0006Xe-JJ for bug-gnu-emacs@gnu.org; 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@flex--alexhutcheson.bounces.google.com>) id 1nKOyX-00007A-RN for bug-gnu-emacs@gnu.org; Wed, 16 Feb 2022 13:24:27 -0500 Received: by mail-yb1-xb49.google.com with SMTP id 2-20020a251302000000b006118f867dadso5839544ybt.12 for ; 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: Mime-Version: 1.0 Subject: Wishlist: Support full CSI u specification for terminal input From: Alex Hutcheson To: bug-gnu-emacs@gnu.org 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@flex--alexhutcheson.bounces.google.com; 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 18:15:09 2022 Received: (at 54027) by debbugs.gnu.org; 17 Feb 2022 23:15:09 +0000 Received: from localhost ([127.0.0.1]:52960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKpzM-0003EE-LF for submit@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 ) id 1nKpzL-0003Az-1E for 54027@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 ) 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 ) id 1nKpzE-0005Pz-I3; Thu, 17 Feb 2022 18:14:56 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Alex Hutcheson In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal input References: Message-Id: Date: Thu, 17 Feb 2022 18:14:56 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54027 Cc: 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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) From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 03:30:29 2022 Received: (at 54027) by debbugs.gnu.org; 18 Feb 2022 08:30:29 +0000 Received: from localhost ([127.0.0.1]:53406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKyen-0002pW-Uj for submit@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 ) id 1nKyeh-0002pA-N6 for 54027@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Alex Hutcheson In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal input References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54027 Cc: 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Resent-From: Alex Hutcheson > Original-Sender: "Debbugs-submit" > Resent-CC: bug-gnu-emacs@gnu.org > Resent-Sender: help-debbugs@gnu.org > 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" > > 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 22 20:08:02 2022 Received: (at 54027) by debbugs.gnu.org; 23 Feb 2022 01:08:02 +0000 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 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 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) MIME-Version: 1.0 References: <8335kg1srp.fsf@gnu.org> In-Reply-To: <8335kg1srp.fsf@gnu.org> From: Alex Hutcheson Date: Tue, 22 Feb 2022 20:07:40 -0500 Message-ID: Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal input To: Eli Zaretskii Content-Type: multipart/alternative; boundary="0000000000003a9ab305d8a51834" X-Spam-Score: -8.0 (--------) X-Debbugs-Envelope-To: 54027 Cc: 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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
> 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-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 03:10:24 2022 Received: (at 54027) by debbugs.gnu.org; 26 Feb 2022 08:10:24 +0000 Received: from localhost ([127.0.0.1]:54223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNs9n-0003RE-MV for submit@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 ) id 1nNs9l-0003Qk-FE for 54027@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Alex Hutcheson In-Reply-To: (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: <8335kg1srp.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54027 Cc: 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Alex Hutcheson > Date: Tue, 22 Feb 2022 20:07:40 -0500 > Cc: 54027@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. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 13:21:39 2022 Received: (at 54027) by debbugs.gnu.org; 27 Feb 2022 18:21:39 +0000 Received: from localhost ([127.0.0.1]:59181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOOAs-0003cu-Ui for submit@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 ) id 1nOOAr-0003cb-S7 for 54027@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@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: <8335kg1srp.fsf@gnu.org> <83mtieoxpj.fsf@gnu.org> In-Reply-To: <83mtieoxpj.fsf@gnu.org> From: Alex Hutcheson Date: Sun, 27 Feb 2022 13:21:20 -0500 Message-ID: Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal input To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000515dbc05d9040078" X-Spam-Score: -8.0 (--------) X-Debbugs-Envelope-To: 54027 Cc: 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 wrote: > > From: Alex Hutcheson > > Date: Tue, 22 Feb 2022 20:07:40 -0500 > > Cc: 54027@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@google.com --000000000000515dbc05d9040078 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> I think just adding the missing combinations is = a better way forward.

I think we're in agreeme= nt here, I was just suggesting how to add=C2=A0
the combinations = to xterm.el without introducing a lot of boilerplate
code.
<= div>
We basically need to support the cross-product of:
modifi= er combinations x ASCII characters

It seems like t= here are 7 possible modifier combinations:
- Control
- = Meta
- Shift
- Control=C2=A0+ Meta
- Control= =C2=A0+ Shift
- Meta=C2=A0+ Shift
- Control= =C2=A0+ Shift=C2=A0+ Meta

The code in the StackExc= hange post (https://ema= cs.stackexchange.com/a/13957)=C2=A0
doesn't add support f= or "Meta=C2=A0+ Shift" or plain "Shift", because those = combinations
generally already=C2=A0result in something that does= n't need any special encoding=C2=A0
(e.g. a capital letter or= symbol, possibly preceded by an ESC character if Meta was
presse= d). So we only *really* need to support=C2=A0the encodings for the remainin= g 5.
At the same time, it might be reasonable to support the othe= r 2, because they're
still valid encodings, so a terminal mig= ht still end up sending them.

Then we have 95 ASCI= I 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 =3D 475 entries=C2=A0
(or 7 x 95 =3D 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 charact= ers) that=C2=A0
=C2=A0 generates those 475 entries at runtime whe= n xterm.el is executed.

If we implement #2, it wou= ld actually allow us to reduce the lines of code in xterm.el,
bec= ause we could delete the existing hard-coded entries.

On Sat, Feb 26, = 2022 at 3:10 AM Eli Zaretskii <eliz@gnu.= org> wrote:
> From: Alex Hutcheson <alexhutcheson@google.com>
> Date: Tue, 22 Feb 2022 20:07:40 -0500
> Cc: 54027@d= ebbugs.gnu.org
>
> - A detailed overview of the issue from the maintainer of xterm.
>=C2=A0 =C2=A0This covers both the original "CSI 27" encoding = and the newer
>=C2=A0 =C2=A0"CSI u" encoding: ht= tps://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
>=C2=A0 xterm.el: https://debbugs.gnu.org/cg= i/bugreport.cgi?bug=3D13839
>
> 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.gn= u.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<= br> 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.


--
--000000000000515dbc05d9040078-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 13:38:52 2022 Received: (at 54027) by debbugs.gnu.org; 27 Feb 2022 18:38:52 +0000 Received: from localhost ([127.0.0.1]:59198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOORY-00042A-3V for submit@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 ) id 1nOORW-00041y-4s for 54027@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Alex Hutcheson In-Reply-To: (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: <8335kg1srp.fsf@gnu.org> <83mtieoxpj.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54027 Cc: 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Alex Hutcheson > Date: Sun, 27 Feb 2022 13:21:20 -0500 > Cc: 54027@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? From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 13:54:15 2022 Received: (at 54027) by debbugs.gnu.org; 27 Feb 2022 18:54:15 +0000 Received: from localhost ([127.0.0.1]:59211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOOgR-0004QJ-15 for submit@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 ) id 1nOOgP-0004Q5-0Q for 54027@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@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: <8335kg1srp.fsf@gnu.org> <83mtieoxpj.fsf@gnu.org> <837d9gnoig.fsf@gnu.org> In-Reply-To: <837d9gnoig.fsf@gnu.org> From: Alex Hutcheson Date: Sun, 27 Feb 2022 13:53:56 -0500 Message-ID: Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal input To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000dba95805d90474ee" X-Spam-Score: -8.0 (--------) X-Debbugs-Envelope-To: 54027 Cc: 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 wrote: > > From: Alex Hutcheson > > Date: Sun, 27 Feb 2022 13:21:20 -0500 > > Cc: 54027@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@google.com --000000000000dba95805d90474ee Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
My thinking is that it's very low-cost to support all = possible encodings,=C2=A0
even if it's unlikely that a terminal wou= ld actually send them.

Using your example:
\e[65;5u
Would be a valid way to encode C-a according to the s= pec at=C2=A0

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

In addition, the "just support all inputs encoded this way" ap= proach
seems simpler to understand and maintain than an approach = that
distinguishes between key combinations that have an existing= =C2=A0
alternative encoding and those that don't.
T= he 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.

Mayb= e I'm misunderstanding keymap performance or some other
impor= tant parameter, though?

On Sun, Feb 27, 2022 at 1:38 PM Eli Zaretskii= <eliz@gnu.org> wrote:
<= 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">> From: Alex Hutcheson = <alexhutch= eson@google.com>
> Date: Sun, 27 Feb 2022 13:21:20 -0500
> Cc: 54027@d= ebbugs.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.=C2=A0 E.g., C-a is already supported, so we don't need to add it, and similarly many other combinations are
already supported.=C2=A0 Or what am I missing?


--
--000000000000dba95805d90474ee-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 14:16:29 2022 Received: (at 54027) by debbugs.gnu.org; 27 Feb 2022 19:16:29 +0000 Received: from localhost ([127.0.0.1]:59217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOP1x-0004wc-2Z for submit@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 ) id 1nOP1s-0004wN-Qd for 54027@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Alex Hutcheson , Stefan Monnier In-Reply-To: (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: <8335kg1srp.fsf@gnu.org> <83mtieoxpj.fsf@gnu.org> <837d9gnoig.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54027 Cc: 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Alex Hutcheson > Date: Sun, 27 Feb 2022 13:53:56 -0500 > Cc: 54027@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 wrote: > > > From: Alex Hutcheson > > Date: Sun, 27 Feb 2022 13:21:20 -0500 > > Cc: 54027@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@google.com From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 22:50:18 2022 Received: (at 54027) by debbugs.gnu.org; 28 Feb 2022 03:50:18 +0000 Received: from localhost ([127.0.0.1]:59759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOX3C-0000Yy-9I for submit@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 ) id 1nOX3A-0000Yh-4B for 54027@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 To: Alex Hutcheson Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal input Message-ID: References: <8335kg1srp.fsf@gnu.org> <83mtieoxpj.fsf@gnu.org> Date: Sun, 27 Feb 2022 22:49:58 -0500 In-Reply-To: (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 , 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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]) From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 28 07:18:07 2022 Received: (at 54027) by debbugs.gnu.org; 28 Feb 2022 12:18:07 +0000 Received: from localhost ([127.0.0.1]:60338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOeyd-0001aQ-EV for submit@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 ) id 1nOeyc-0001a0-AM for 54027@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (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: <8335kg1srp.fsf@gnu.org> <83mtieoxpj.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54027 Cc: alexhutcheson@google.com, 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Eli Zaretskii , 54027@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? From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 28 08:22:30 2022 Received: (at 54027) by debbugs.gnu.org; 28 Feb 2022 13:22:30 +0000 Received: from localhost ([127.0.0.1]:60512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOfyw-0007ot-Cx for submit@debbugs.gnu.org; Mon, 28 Feb 2022 08:22:30 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47943) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOfyf-0007oL-SZ for 54027@debbugs.gnu.org; Mon, 28 Feb 2022 08:22:29 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7F1B2100189; Mon, 28 Feb 2022 08:22:08 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0C299100054; Mon, 28 Feb 2022 08:22:07 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1646054527; bh=FN1uoq72Td3nWL5/TQ+KTHKAExl1C1WlEy7tMf8cUqU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ArZO220PtAzL15uBAsMQcdM0JAJQ8y0CLloX+shJ+BOYPJeMIFebUf126VxK5+BCu a3xtg4lx4dLeMOAWLDC5jQaf/FZ8VQQlOainvKZvbu4tfSaVMWdJMZI5/kxMDYksWR vdmtdMYAIRx9qLazbzflYexI1WKiJg4ZxMl0Kq9wzid/gDAF7V5eOtCSAgz4Y4SwEo 7mblFgz/xT8Qqrj+6m32qMsYae236GedCQ/phma0i/orE4sr+L3Ut0OYMv329CRQA2 IlD7vtLllK1p9k4HjbnosISig0cKDlPE/XURT3FpkDmKDlLQwzFbITVjuabkgwiVAH MjnFUoZx7KGzQ== Received: from pastel (unknown [45.72.208.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D4ECF120EEF; Mon, 28 Feb 2022 08:22:06 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal input Message-ID: References: <8335kg1srp.fsf@gnu.org> <83mtieoxpj.fsf@gnu.org> <831qznnq1i.fsf@gnu.org> Date: Mon, 28 Feb 2022 08:22:05 -0500 In-Reply-To: <831qznnq1i.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 28 Feb 2022 14:17:45 +0200") 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.045 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: -0.0 (/) X-Debbugs-Envelope-To: 54027 Cc: alexhutcheson@google.com, 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii [2022-02-28 14:17:45] wrote: >> 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? The patch I posted adds all of them, and that reflects my opinion (tho the patch only bothered to do it for the `ESC [ 27 ...` format). Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 28 08:32:08 2022 Received: (at 54027) by debbugs.gnu.org; 28 Feb 2022 13:32:08 +0000 Received: from localhost ([127.0.0.1]:60535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOg8G-00084n-48 for submit@debbugs.gnu.org; Mon, 28 Feb 2022 08:32:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOg8E-00084K-9I for 54027@debbugs.gnu.org; Mon, 28 Feb 2022 08:32:06 -0500 Received: from [2001:470:142:3::e] (port=40332 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 ) id 1nOg89-0003oF-18; Mon, 28 Feb 2022 08:32:01 -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=5Dui8q0Wz95ncH82eFmmjy5fT+ix/YsK7RhMpxQsqeg=; b=f7l/ViKhA34A tj3MTGEfJPk6sD8dFID6YLHCW8QcyslIfYBVZ234w78dfr01/mRKayQEqRT374hDolJIDCOqJYJ7C SKoJ0z/hh+a4b/hK6HZoqrXyab5HWkGFFHnv7Q17grjVHrymTeaqcnrj1hgOAzdgT+g2vrRQNY1VL TUlGSRCYN34UuyQmM0+aFWfh1uGDUbChuFC7sQztTzuITE9wZObwApR2dJ9F/GGJDkpzSn8TsNqQd mJ7wiiMZT4VtPS8n879JnzPDbhMcw9wp7UNg1i+6oO9cigXDh/hErRAvQhgQFgO/sxKI0LeBDTUDV eivTV9L1Wsva866a7T5UuQ==; Received: from [87.69.77.57] (port=2040 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOg86-0001u6-UP; Mon, 28 Feb 2022 08:32:00 -0500 Date: Mon, 28 Feb 2022 15:31:49 +0200 Message-Id: <83k0dfm81m.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Mon, 28 Feb 2022 08:22:05 -0500) Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal input References: <8335kg1srp.fsf@gnu.org> <83mtieoxpj.fsf@gnu.org> <831qznnq1i.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54027 Cc: alexhutcheson@google.com, 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: alexhutcheson@google.com, 54027@debbugs.gnu.org > Date: Mon, 28 Feb 2022 08:22:05 -0500 > > > Thanks, but what is your opinion about which of the combinations we > > need to add? > > The patch I posted adds all of them, and that reflects my opinion (tho > the patch only bothered to do it for the `ESC [ 27 ...` format). Then I must be missing something. Do you mean this part: + (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))) This doesn't add all the 96 characters with the modifiers, it only adds the digits and the punctuation characters. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 28 10:25:54 2022 Received: (at 54027) by debbugs.gnu.org; 28 Feb 2022 15:25:54 +0000 Received: from localhost ([127.0.0.1]:34569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOhuM-0002vO-AN for submit@debbugs.gnu.org; Mon, 28 Feb 2022 10:25:54 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2891) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOhuK-0002vA-KH for 54027@debbugs.gnu.org; Mon, 28 Feb 2022 10:25:52 -0500 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A83E9805CC; Mon, 28 Feb 2022 10:25:46 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5699D80582; Mon, 28 Feb 2022 10:25:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1646061945; bh=vlcxZG1J1B+KCTv5Hza7hgmEGi7j1W+G0j1mwG25lP8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=EDD7eO02NvAME+35Sq8JOGI39IsOEHC06S/NZdwjc0FQI3fXPDXdySDkJ1qA6AZl9 GHDWzRFOYXvjRbi6YscCLt9VCB3rY3YS2pGqfVSvxjDxK4//U3DPdAcO1qP6Z4+63C 09iQVME/tl8qF47oRfGLYCzs/0ZbVpvJG7VlzjDqSfM7HlyHeAEDp3uEE9OE26Lc2j 29KwV+1/IoIqIoAD4wnowME1CfqLRVK9L09gssgNYqURkXYp37RNdlBMGxR4fCy3Ah lxB6bCNRuVne1d4UWmct/dkc7RykDnrEyZM7uz3YqKuAJvgX3Ohr6ebHKVrWY0WTKQ LywRpomdlY7sA== Received: from pastel (unknown [45.72.208.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2D202120F21; Mon, 28 Feb 2022 10:25:44 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal input Message-ID: References: <8335kg1srp.fsf@gnu.org> <83mtieoxpj.fsf@gnu.org> <831qznnq1i.fsf@gnu.org> <83k0dfm81m.fsf@gnu.org> Date: Mon, 28 Feb 2022 10:25:42 -0500 In-Reply-To: <83k0dfm81m.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 28 Feb 2022 15:31:49 +0200") 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: alexhutcheson@google.com, 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Then I must be missing something. Do you mean this part: > > + (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))) > > This doesn't add all the 96 characters with the modifiers, it only > adds the digits and the punctuation characters. The above just reads to "NN;MM" part of the escape sequence which encodes in decimal the Unicode code point MM of the character and the 4bit encoded NN of the modifiers shift, alt, control, and meta. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue May 24 21:25:26 2022 Received: (at 54027) by debbugs.gnu.org; 25 May 2022 01:25:26 +0000 Received: from localhost ([127.0.0.1]:53911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntfmA-0008M6-CI for submit@debbugs.gnu.org; Tue, 24 May 2022 21:25:26 -0400 Received: from mail-vk1-f182.google.com ([209.85.221.182]:42528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntfm5-0008Lp-Ms for 54027@debbugs.gnu.org; Tue, 24 May 2022 21:25:25 -0400 Received: by mail-vk1-f182.google.com with SMTP id e144so9240187vke.9 for <54027@debbugs.gnu.org>; Tue, 24 May 2022 18:25:21 -0700 (PDT) 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=zAG4MHriX7lOi2OTtnYPX3/DeNRdfGm8CGsRYeZ9JAw=; b=oONUh7PkUetuXyzo2dWeAjxXIbdgS+YSUzGmTRV6uiETSG0E8T9Y5E6ETd/mx50oWO PN5qPjLerw1If0Sb434Z4ZPiV4W4pgXSq5NctgCh5j+nWalcSvqZYsWjCrvL95wFru9K qiOMnFzdwE7vjCOFKoeafzztgOH6zOW4VqjIFRFZPS63pWzD8vrWmRpqKuObfqkOPhjI LihfAnQoO6zZD2fg89XCePSoa/LWZKEuAgCo4n4CJHCHTQP+GMDRxlieS+qf1NmwGdbR eACapx7KWWG8s5StJqjsH6TEOlfrU2TFXyjJ+v7reFvJ1Mh01Q5QUo77VYXYGY1cb2Ug GJqQ== 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=zAG4MHriX7lOi2OTtnYPX3/DeNRdfGm8CGsRYeZ9JAw=; b=ACzUTLZCdfSnnx+O8Z+DYb0PFHCwMLVmT9FwuhHSLO7R3DH+L+2MiyTxMbUimR0GA8 e8eHGocGLXcAYWVZZI01TSY317kMlkbSW5qIhwI6MKiFdGG0YppTGEd9KurHhqn4usPZ oo3+dvbvwmpPN0HvGHMM3NShtdepdHAtX3eav3IuY0OqcprlKvp9xdApUZ885r2v1GW8 W8JYFHhH3lR/kng3yO8LPI6bxe9F3D6H8f+bx552+iye9YlQsx7IEvxWTnRiFLxx54HZ vzeICZV9Us8qa5yViGTPr4BchtzcnJCd1aOwqnyFmNsCoRADTE0epMd8Y69bl89qvnhE OUaA== X-Gm-Message-State: AOAM533I/PYmU1llFo5XiQ4ZOfUXRGFJU/eV0CMJ4Ly6k2I5g/gCWD8F utXoTgJpMTKRyDGqX/UPfCpW/XPC+c18pTsZzeEBM3cGBpt+Aw== X-Google-Smtp-Source: ABdhPJxgAGuaWdGKax5Uz3hCr7tdPIT7xB7mgRXbVfTG4g/3uDuPWG7a0Vi1ZThC+xw15TMrkLzLzsJDJdepHiEmxV8= X-Received: by 2002:a1f:2a01:0:b0:357:907f:7dea with SMTP id q1-20020a1f2a01000000b00357907f7deamr5660612vkq.7.1653441915881; Tue, 24 May 2022 18:25:15 -0700 (PDT) MIME-Version: 1.0 References: <8335kg1srp.fsf@gnu.org> <83mtieoxpj.fsf@gnu.org> <831qznnq1i.fsf@gnu.org> <83k0dfm81m.fsf@gnu.org> In-Reply-To: From: Alex Hutcheson Date: Tue, 24 May 2022 21:25:03 -0400 Message-ID: Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal input To: Stefan Monnier Content-Type: multipart/alternative; boundary="0000000000000dfaee05dfcbf25a" X-Spam-Score: -8.0 (--------) X-Debbugs-Envelope-To: 54027 Cc: Eli Zaretskii , 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -9.0 (---------) --0000000000000dfaee05dfcbf25a Content-Type: text/plain; charset="UTF-8" Was a consensus ever reached on this? Stefan's patch looks like it does what I was asking for. It would be great if we could also handle the `ESC [ ... u` versions, because xterm will emit them in some configurations, and iTerm2 can only emit those. On Mon, Feb 28, 2022 at 10:25 AM Stefan Monnier wrote: > > Then I must be missing something. Do you mean this part: > > > > + (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))) > > > > This doesn't add all the 96 characters with the modifiers, it only > > adds the digits and the punctuation characters. > > The above just reads to "NN;MM" part of the escape sequence which > encodes in decimal the Unicode code point MM of the character and the > 4bit encoded NN of the modifiers shift, alt, control, and meta. > > > Stefan > > --0000000000000dfaee05dfcbf25a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Was a consensus ever reached on this?=C2=A0

=
Stefan's patch looks like it does what I was asking for.=C2=A0

It would be great if we could also handle the=C2=A0`E= SC [ ... u` versions, because xterm will emit them in=C2=A0
some = configurations, and iTerm2 can only emit those.

> Then I must be missing something.=C2=A0 Do yo= u mean this part:
>
>=C2=A0 =C2=A0+=C2=A0 =C2=A0 (while (<=3D #x30 final #x3F)
>=C2=A0 =C2=A0+=C2=A0 =C2=A0 =C2=A0 (push final params) ;And read more.<= br> >=C2=A0 =C2=A0+=C2=A0 =C2=A0 =C2=A0 (setq final (read-char)))
>=C2=A0 =C2=A0+=C2=A0 =C2=A0 (while (<=3D #x20 final #x2F)
>=C2=A0 =C2=A0+=C2=A0 =C2=A0 =C2=A0 (push final intermediates)
>=C2=A0 =C2=A0+=C2=A0 =C2=A0 =C2=A0 (setq final (read-char)))
>
> This doesn't add all the 96 characters with the modifiers, it only=
> adds the digits and the punctuation characters.

The above just reads to "NN;MM" part of the escape sequence which=
encodes in decimal the Unicode code point MM of the character and the
4bit encoded NN of the modifiers shift, alt, control, and meta.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--0000000000000dfaee05dfcbf25a-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 24 22:34:08 2022 Received: (at 54027) by debbugs.gnu.org; 25 May 2022 02:34:08 +0000 Received: from localhost ([127.0.0.1]:53979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntgqd-0003vO-Jc for submit@debbugs.gnu.org; Tue, 24 May 2022 22:34:07 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntgqb-0003uc-Sf for 54027@debbugs.gnu.org; Tue, 24 May 2022 22:34:06 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5CDB48007C; Tue, 24 May 2022 22:34:00 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D14438044E; Tue, 24 May 2022 22:33:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1653446038; bh=nfN7tAhsFlTgnHPcA7Nw17JwwJLG7FSMxtMWmVXgkMk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=a5w8aJsWFTQghLqm2N8PRO5FigpCZeWsGJhVnORx7toqJZuYc9Y4ZvnLZYjrTReUc otCK6xUaoOIUqZ3afQVGozBNGUo6dvIPB/X0WbRa4qQbtMltGA0XeSCFoTYR6z4Kxh viI657L3LCJZ/r2SIZMammgcqwgyMT2x/tdyz/RHnayaa2iyqrK75bAdG3fzjauJ+3 WpQH9dsLWt5Sg7PTztnKjYn1iPHheWtNKpND/p3g+CVEy1lkZMx+RiLx7smim9jasV RHUBAzI7fgmERfQVugds0GPK0AplGaEGTSTgQ4q+Kh/7RrzCxiFXYwIvwxWAo8aSkE ihuGrif+hRaVg== Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9B364120175; Tue, 24 May 2022 22:33:58 -0400 (EDT) From: Stefan Monnier To: Alex Hutcheson Subject: Re: bug#54027: Wishlist: Support full CSI u specification for terminal input Message-ID: References: <8335kg1srp.fsf@gnu.org> <83mtieoxpj.fsf@gnu.org> <831qznnq1i.fsf@gnu.org> <83k0dfm81m.fsf@gnu.org> Date: Tue, 24 May 2022 22:33:57 -0400 In-Reply-To: (Alex Hutcheson's message of "Tue, 24 May 2022 21:25:03 -0400") 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.055 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 , 54027@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Alex Hutcheson [2022-05-24 21:25:03] wrote: > Was a consensus ever reached on this? > Stefan's patch looks like it does what I was asking for. I didn't install my patch because IIUC it interferes with some other bindings (it takes over a particular ESC prefix which some other package also needs to use). IOW it needs to be improved so that it can cooperate with other users of such key sequences. IIRC `xt-mouse.el` is affected, for example. Stefan