From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jared Finder via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73469: 29.4; mouse passing on terminal window generates events Date: Sun, 29 Sep 2024 12:10:57 -0700 Message-ID: <8f37fa3bd8db84dc9bd90346d88f4200@finder.org> References: <861q17d9f0.fsf@gnu.org> <86plop8kbk.fsf@gnu.org> <061a28e3635baae59f37a94bbe37d295@finder.org> Reply-To: Jared Finder Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29160"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73469@debbugs.gnu.org, Eli Zaretskii To: Francesco =?UTF-8?Q?Potort=C3=AC?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 29 21:11:46 2024 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 1suzKc-0007Sn-BU for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 29 Sep 2024 21:11:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suzKP-0000gL-Hm; Sun, 29 Sep 2024 15:11:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suzKN-0000g3-1C for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 15:11:31 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1suzKM-00067z-Oj for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 15:11:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:MIME-Version:To:Subject; bh=jwxIqauMYToM9y7DYrvCl38U1CwuyQEL9R37OyMw4ME=; b=QEyVZfIRy8o+jCX6SolonWbTCIzKOuUQSUR8vciPhyOT5mZ+K1nQ/MfDOxfryn6u1HaitrGqoIC2DqPYZTUDtnzeiPFCAuD3UBYktE9A6z5RJ1QLqbIBCIudwWDUHKce6XHnSAEytQYW73Ne8KUszdzyWbWVOv6SXihjq4TGbgPQBLCiwgyobg6b2A7tj4hTrAdTaYbFCMYjNZkHpY60I6gHv9nJi7P5Alf7OYnRlASX4/Lxue1jgKR9i9cU3UEihhFYGRd7eZj9Ty4TGFJ+UgksqqW8RewuVFaM2MqcIT5k7MHdx90/6Z7fxyI53/Tsd0RJZSv4EEYcqm2A5tAaEA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1suzKs-0005rX-C0 for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 15:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jared Finder Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Sep 2024 19:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73469 X-GNU-PR-Package: emacs Original-Received: via spool by 73469-submit@debbugs.gnu.org id=B73469.172763709322505 (code B ref 73469); Sun, 29 Sep 2024 19:12:02 +0000 Original-Received: (at 73469) by debbugs.gnu.org; 29 Sep 2024 19:11:33 +0000 Original-Received: from localhost ([127.0.0.1]:41798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suzKP-0005qv-0F for submit@debbugs.gnu.org; Sun, 29 Sep 2024 15:11:33 -0400 Original-Received: from greenhill.hpalace.com ([192.155.80.58]:49890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suzKM-0005qp-GJ for 73469@debbugs.gnu.org; Sun, 29 Sep 2024 15:11:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=finder.org; s=2018; t=1727637057; bh=ZIEQ0Q3zMvEDmOKWFikWb7E2OqCcBtDuZt9+zb4s02U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VUX9klIAsZozedykdSkN+0EaHPhmG+vaIcbbuMrazisO6n3osxYCKC6p1Mk//HHk6 X1i/5WB8RGMJR/s5gPBkwlW9AeiHjaFQzN2TGfL0IStG8jd7NBtargL34zhIgiHrS3 tVbi+O9mv/5NFTjIksUXr5btvVEd3UQ5/FGSm81AX5Z4UY8qjkafhrwQi3RUcJ036B vHkbtWd6F69QXl+XdoJTT4zMnjYgJSw/6oaXA5drbLnsR5M+hjPwP5d+sklfbv6eAa 6sbt80rOmkDq0M9ax8F4HT9w7Ua8EN1yh61OywktH2CG7YS4LFoulqQAA7Dp+c6VnE Llj8+PPBZRPNw== Original-Received: from mail.finder.org (unknown [192.155.80.58]) by greenhill.hpalace.com (Postfix) with ESMTPSA id C8619D3A; Sun, 29 Sep 2024 19:10:57 +0000 (UTC) In-Reply-To: X-Sender: jared@finder.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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292662 Archived-At: On 2024-09-29 01:52, Francesco Potortì wrote: >>>> I have found the culprit: it is xterm-mouse-mode. >> >> Could you please reshare the lossage, making sure you are moving the >> mouse around over an otherwise empty buffer and not holding any >> modifiers or mouse buttons? > > Here you are. This is the mouse moving on an empty region of the > terminal frame I'm using under Screen, after M-x xterm-mouse-mode, > without touching any mouse buttons, wheels or keyboard modifiers: > > 3 5 ; C- 7 0 ; 1 1 M ESC [ M 3 5 ; C- 7 0 ; 1 1 M > ESC [ M 3 5 ; C- 7 0 ; 1 1 M ESC [ M 3 5 ; C- 7 0 ; 1 > 1 M ESC [ M 3 5 ; C- 7 0 ; 1 1 M ESC [ M 3 5 ; C- 7 0 > ; 1 1 M ESC [ M 3 5 ; C- 6 8 ; 1 2 M ESC [ M 3 5 ; C- > 6 6 ; 1 2 M ESC [ M 3 5 ; C- 6 6 ; 1 2 M ESC [ M 3 5 ; > C- 6 5 ; 1 2 M ESC [ M 3 5 ; C- 6 5 ; 1 2 M ESC [ M 3 > 5 ; C- 6 4 ; 1 2 M ESC [ M 3 5 ; C- 6 1 ; 1 2 M ESC [ > M 3 5 ; C- 5 9 ; 1 2 M ESC [ M 3 5 ; C- 5 7 ; 1 2 M > ESC [ M 3 5 ; C- 5 7 ; 1 2 M ESC [ M 3 5 ; C- 5 6 ; 1 > 2 M ESC [ M 3 5 ; C- 5 6 ; 1 2 M ESC [ M 3 5 ; C- 5 5 > ; 1 2 M ESC [ M 3 5 ; C- 5 5 ; 1 2 M ESC [ M 3 5 ; C- > 5 4 ; 1 2 M ESC [ M 3 5 ; C- 5 4 ; 1 2 M Thank you. Reading over the xterm control sequence specs, it looks like somehow URXVT (1015) mode got enabled. This is strange as xterm-mouse-mode only enables modes 1000, 1003, 1006, and (depending on user option) 1005. The rest of Emacs doesn't enable 1015 either. Mode 1015 is specifically not enabled as it sends the same info as mode 1006 but in a way that can be ambiguous relative to other control sequences. I suspect your terminal emulator or the screen utility is adding this additional mode. Can you try running the following commands outside of Emacs? I'm curious if a particular combination of screen and the terminal emulator is forcing mode 1015 on. To manually enable the modes, run the following commands at a shell: echo -e "\e[?1000h" # Enable mouse button down and up reporting echo -e "\e[?1003h" # Enable mouse movement reporting echo -e "\e[?1006h" # Change format to use printable numbers instead of encoded bytes At this point, moving a clicking the mouse will add characters to the input, similar to the lossage listed above. You can disable these mouse tracking modes by using "l" at the end instead of "h": echo -e "\e[?1000l" echo -e "\e[?1003l" echo -e "\e[?1006l" I'd also be curious if manually disabling mode 1015 does anything with the above modes activated. In a shell that's echo -e "\e[?1015l" and in Emacs that would be (send-string-to-terminal "\e[?1015l"). If you could try all of the above, in your shell both with and without screen running it would be helpful for narrowing down the source of the bug. And if evaluating the send-string-to-terminal expression fixes things while still supporting mouse clicks and hover events, that's a simple workaround I can add to xt-mouse. > Now I'm doing the same with emacs -Q under a fresh Screen window whose > TERM I set to screen.linux: > ... lossage elided ... > > Same as above (that is, in a Screen window), with TERM set to > xterm-256color: I hope I can save you some time: there's no need to test different values of TERM here. xt-mouse doesn't pay attention to the TERM environment variable and just sends the xterm control sequences to the terminal. -- MJF