From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled Date: Sat, 28 Dec 2024 10:54:22 +0200 Message-ID: <86ldw0ur0h.fsf@gnu.org> References: <8634iszpa5.fsf@gnu.org> <86y10ky9wf.fsf@gnu.org> <86wmg4xd2u.fsf@gnu.org> <86y10jwmsb.fsf@gnu.org> <86ldwiwvjc.fsf@gnu.org> <86ed27pfhj.fsf@gnu.org> <86a5cvpeiv.fsf@gnu.org> <86y10eo5h6.fsf@gnu.org> <986a3eea465e13c57bcdd7ce8f27f99d@finder.org> <864j2w6tz0.fsf@gnu.org> <861pxy5zxk.fsf@gnu.org> <86jzbq4i6x.fsf@gnu.org> <86frme4exq.fsf@gnu.org> <865xn5y2n0.fsf@gnu.org> <5e102d7d29eba618874c0b41e9815b8d@finder.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21166"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, 74833@debbugs.gnu.org, fgunbin@fastmail.fm, shipmints@gmail.com, rms@gnu.org To: Jared Finder Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 28 09:55:09 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 1tRSbF-0005LV-80 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Dec 2024 09:55:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRSbB-0000RH-9R; Sat, 28 Dec 2024 03:55:05 -0500 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 1tRSb9-0000P8-5T for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 03:55:03 -0500 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 1tRSb8-0005gy-SN for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 03:55:02 -0500 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:To:Subject; bh=KIaOUYxrVUcIZQLygh9pJrOQHZNaeES3+3cvxxGqlMs=; b=UzNyFy3bx7L8e+vJv2g72jGtenvLVrI8QIt5NO0YHzB5o74i7tyx33H/SEhU2xkNfhX9raGMtEAf7odsxmzaWPL9/SyPhvBaD4ThGSSma84RYTRyKHVk8QSgrIx2OG6ZAjHymk0fSCYKv12hoFcfdnwfchkQmHKs/edFOSC0ijqJLb4Je0QX8dqflr2koXtMSIcqoeFjmxHiKEFfskVJL13NjMjgg4N+MPrkb+79bDWVwOGQFuXjtj02OLvT48izGA4IkX3OaWcRBIt+9ahJpISeeBldiieUFeuvdxEN9j2QcxEx6rwRZeMt/DlG/TwqieglYSPGq3Fp1QZbxs6W+Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tRSb8-0000FU-Mp for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 03:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Dec 2024 08:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74833 X-GNU-PR-Package: emacs Original-Received: via spool by 74833-submit@debbugs.gnu.org id=B74833.1735376080911 (code B ref 74833); Sat, 28 Dec 2024 08:55:02 +0000 Original-Received: (at 74833) by debbugs.gnu.org; 28 Dec 2024 08:54:40 +0000 Original-Received: from localhost ([127.0.0.1]:48728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRSam-0000Ec-1R for submit@debbugs.gnu.org; Sat, 28 Dec 2024 03:54:40 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRSaj-0000EH-5z for 74833@debbugs.gnu.org; Sat, 28 Dec 2024 03:54:37 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRSad-0005bv-Or; Sat, 28 Dec 2024 03:54:31 -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=KIaOUYxrVUcIZQLygh9pJrOQHZNaeES3+3cvxxGqlMs=; b=DPVxOEllA74g 4F6MoHZ7V5vpKPEg9SMm1J7NhTARo0knrDF4nL1p/tRnqUEkUhXiEVNIIoVUBv/ENXodQJHArv/qB 08yicE3yWrAmRNXy0S691AywvZzS1EyrKtUJh0rIPRRNuqCJurZc1KwIXF4PGBYAq+W9gxrRUbalr BXznGiQdAxvwF09g3M378oKa59LEmPb20BizHZbpurWAQ3dt8Z4uJ7IzoOtBHJ336iR0/vzU4XR+X zIj6UyVvu4D9tjsDKrTvrJBz+PATpkXe77Bf5pjKvUkEmdswT6kBuhaeQMwVr7+ARlDI4Nd8nbVoI B6MGSh34WkKoTuH8pLJupw==; In-Reply-To: <5e102d7d29eba618874c0b41e9815b8d@finder.org> (message from Jared Finder on Fri, 27 Dec 2024 23:08:27 -0800) 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:297863 Archived-At: > Date: Fri, 27 Dec 2024 23:08:27 -0800 > From: Jared Finder > Cc: shipmints@gmail.com, rms@gnu.org, gerd.moellmann@gmail.com, > fgunbin@fastmail.fm, 74833@debbugs.gnu.org > > >> What if we only auto-enabled xterm-mouse-mode on OSC52 compatible > >> terminals? > > > > On OSC52 compatible terminals, or on OSC52 compatible terminals that > > define TERM to xterm-like string? The latter sounds like a good idea > > to me, but only if support for OSC52 necessarily means xterm-mouse > > escape sequences must be supported. Is this conjecture indeed true? > > I'm proposing Emacs have a manually curated allow list for now for > auto-enabling xterm-mouse-mode. Being OSC52 compatible gets us the copy > / paste issue this bug mentioned. We can add other conditions going > forward. What would this allow list specify, and in what terms? When reading your proposal above, I thought we have a means of testing the OSC52 support, but now you seem to be saying that this support should be somehow specified by a database of terminals we maintain? ANd if so, the question of detecting a non-xterm terminal that sets TERM to xterm but doesn't support OSC52 still stands, doesn't it? > >> Between $TERM and the results from the terminal escape > >> sequence "ESC [ > 0 q", Emacs can have high confidence if it is > >> running > >> on an OSC52 compatible terminal. I checked against most of the > >> terminals > >> mentioned at > >> https://can-i-use-terminal.github.io/features/osc52copy.html I just > >> wasn't able to test Foot (Wayland-only), hterm (Chromebook-only), > >> mintty > >> (Cygwin-only), or xterm.js (I have no idea how to test). > > > > How do I check this? can you show some script or Lisp or whatever you > > used to check? > > Run the following lisp code in Emacs: > > (progn > (send-string-to-terminal "\e[>0q") > (let ((str "") > chr) > (while (setq chr (xterm--read-event-for-query)) > (setq str (concat str (string chr)))) > str)) > > You should get the string "\eP>|terminal name and version\e\\". For > example, under iTerm2 I get iTerm2 3.5.10 as the terminal name and > version and under Kitty I get kitty(0.38.1). And if the terminal does NOT support OSC52, what should I expect to happen?