From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin 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: Mon, 16 Dec 2024 19:32:22 +0300 Message-ID: References: <8634iszpa5.fsf@gnu.org> <86y10ky9wf.fsf@gnu.org> <86wmg4xd2u.fsf@gnu.org> <86y10jwmsb.fsf@gnu.org> <86ldwiwvjc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11992"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Jared Finder , 74833@debbugs.gnu.org, shipmints@gmail.com To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 16 17:33:12 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 1tNE1u-0002os-Q6 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Dec 2024 17:33:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNE1q-0004XN-BR; Mon, 16 Dec 2024 11:33:07 -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 1tNE1m-0004UC-MM for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 11:33: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 1tNE1m-0001QX-9E for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 11:33:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=RVHbFVEyut8rLyzT0WLlXn4ykkU6SykHa8aW9S27fp8=; b=dg0gjFJXn+a/sYSQ1XajlCHXaTQUE7eBK4M25DpaD1a5Pi7NsSLZHroEb80MSe6Cvx4HG3oxdUus8Lht8LyR3racs3sUwrQSILiJs/OrM6bYVrMOndCKanS3WyWDo2yMQq0vYLAtHL5BeLGr2qU7NChIAfNNlsXRRFsvDVBFZp5qX/dAnMFoJD9y0TNN8lLcS03s79k2NRQkf5oj2v7WempOXGLmfWeniBo0hWixjbvaI4G5659EwvZJGrCmYwvQiOVafXvvFJI8O3Odehn23gpQ0l5iNo9xkdZ1IDqgEBmUZy9ctJkXzDln8GB8iZf+Cg0RLPiBf8zcd2xWG+1ruQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNE1m-00037H-3l for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 11:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Filipp Gunbin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Dec 2024 16:33: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.173436675811921 (code B ref 74833); Mon, 16 Dec 2024 16:33:02 +0000 Original-Received: (at 74833) by debbugs.gnu.org; 16 Dec 2024 16:32:38 +0000 Original-Received: from localhost ([127.0.0.1]:55732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNE1N-00036C-EQ for submit@debbugs.gnu.org; Mon, 16 Dec 2024 11:32:37 -0500 Original-Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]:47009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNE1L-00035n-JV for 74833@debbugs.gnu.org; Mon, 16 Dec 2024 11:32:37 -0500 Original-Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 488CD254011C; Mon, 16 Dec 2024 11:32:30 -0500 (EST) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Mon, 16 Dec 2024 11:32:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1734366750; x=1734453150; bh=RVHbFVEyut8rLyzT0WLlXn4ykkU6SykHa8aW9S27fp8=; b= Pj1BoT/x9SdatAmET5Hlo0H8KakME9Iq5dlyiuQXUQfvo+VppvFRSLGtKsxFFOj8 3+VPJ3uCswZ1f+FauajXFNz5yUNUE82ghzsN9Z+7Xdm5XDe3vPS6MmVTff+n7KvY UTeeu4rV5wtGTXKQUx7gfvxoZBh/WZ+lVPzwfQxWgIpoUaDmuz+Iz9yS0B/4HSh3 Mzi7GLAs4+gzMZ7Sl0vdvoScIOlpw9itdMf6a1Tn4d4IVr2i9xrrf2l8msvY1CCO jjBqyXGTksfQjmcS2nDf9f6Q68tKVjWsPFlaVvXXkSQ/6GLH4qnx7pkiSv3t0MUA UxxN7gMYRanCKkWEXLlbxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734366750; x= 1734453150; bh=RVHbFVEyut8rLyzT0WLlXn4ykkU6SykHa8aW9S27fp8=; b=m +RzNRc9ZJh2oQVp8Sicxj6md9KeyXuYOJO2hfPGtogM4NYVk2aRVCJ8xLDe7wD1h hp0RWBrQBqe+7g1Y7rT8WJhSmdwQr3sZbUwg45BA0YT3bVyM3z6j+XRyhCcaolzO oSsZkoYw2GtAQVxG97NAaIxMVyQOU1FXzFzpPQuxtEr7Se5ZB1m5PB0oF3xcVEau aLwttj96ptO9yVrwA2Dww4nCRV1hNbeVSMqnuIhBzTWjF7vcacgjuZPjE4ixSJf2 32K8/qQwu1mt2yGe/ZD+yszjfySn0826MDmHABNyMrSKxVsDsSk3ziWYqnPngdmM xoiGLHYP6XB6YVS8QgChQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrleefgdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufgjfhgffffkgggtgfesthhqredttderjeen ucfhrhhomhephfhilhhiphhpucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhmrg hilhdrfhhmqeenucggtffrrghtthgvrhhnpeefleefffetieetuedvtedtgfehgeevtefh ueevjeehjeelueeigfevtdeihfeugeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehfghhunhgsihhnsehfrghsthhmrghilhdrfhhmpdhnsggp rhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehshhhiphhmih hnthhssehgmhgrihhlrdgtohhmpdhrtghpthhtohepjeegkeeffeesuggvsggsuhhgshdr ghhnuhdrohhrghdprhgtphhtthhopehjrghrvggusehfihhnuggvrhdrohhrghdprhgtph htthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopehgvghrugdrmhhovghllhhm rghnnhesghhmrghilh X-ME-Proxy: Feedback-ID: id48c41f1:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Dec 2024 11:32:26 -0500 (EST) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Sat, 14 Dec 2024 10:40:50 +0100") 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:297185 Archived-At: On 14/12/2024 10:40 +0100, Gerd M=C3=B6llmann wrote: > Eli Zaretskii writes: > >>> From: Filipp Gunbin >>> Cc: shipmints@gmail.com, 74833@debbugs.gnu.org >>> Date: Fri, 13 Dec 2024 23:32:39 +0300 >>>=20 >>> On 13/12/2024 18:49 +0200, Eli Zaretskii wrote: >>>=20 >>> >> From: Filipp Gunbin >>> >> Cc: Ship Mints , 74833@debbugs.gnu.org >>> >> Date: Fri, 13 Dec 2024 19:35:15 +0300 >>> >> >>> >> On 13/12/2024 09:21 +0200, Eli Zaretskii wrote: >>> >> >>> >> > So why is this an Emacs bug? It sounds like the OP expects someth= ing >>> >> > to happen which shouldn't, because the xterm protocol for selectio= ns >>> >> > and the clipboard are not supported by Terminal.app? In that case, >>> >> > this could be at best a feature request, not a bug. >>> >> >>> >> I'll try to explain differently. >>> >> >>> >> Without xterm-mouse-mode you can copy/paste from/into Terminal.app >>> >> window, looks like Terminal.app gives this ability on its own. This= is >>> >> not integration with Emacs kill ring, no. Emacs cursor does not rea= ct >>> >> to mouse clicks, and selection happens with OS mouse pointer. Paste >>> >> works rather slow (bad idea to paste large chunks of text), but >>> >> tolerable. >>> >> >>> >> Now, yesterday my daily master build got me xterm-mouse-mode enabled= , so >>> >> I did some testing just out of curiosity. Most of the things work, >>> >> including clicking and selection. However, Command-C now just doesn= 't >>> >> copy text to OS clipboard. And it's non-obvious that you should dis= able >>> >> xterm-mouse-mode to be able to copy. >>> > >>> > xterm-mouse-mode is supposed to be enabled only on terminals that load >>> > xterm.el, which means they are xterm-compatible. Does Terminal.app >>> > load xterm.el on startup? >>>=20 >>> Terminal.app sets TERM=3Dxterm-256color (this is configurable in "Setti= ngs >>> -> Profiles -> Advanced -> Declare terminal as", I doubt I ever changed >>> it), so xterm.el should be loaded, yes. >>>=20 >>> Other term-related vars are: >>>=20 >>> TERM_PROGRAM=3DApple_Terminal >>> TERM_PROGRAM_VERSION=3D453 >>> TERM_SESSION_ID=3D1251C872-8246-4380-A2AE-ED1F8B649878 >> >> Then we should amend xterm.el to not allow xterm-mouse on this >> terminal. Jared, could you please add such a condition? >> >> And I think the Terminal.app developers should be told that pretending >> to be xterm without full support for all the xterm features is not >> TRT, and they should stop. Would someone please file an issue with >> their issue tracker? > > I still think that this is a cockpit error. > > Terminal.app's Command-C can only copy a selection that the app knows > about. Not really - with xterm-mouse-mode disabled (and with "Allow mouse reporting" ticked in Terminal.app menu), mouse selection in Terminal.app is not related to Emacs selection, and copy / paste works. > If the mouse is used by an app like Emacs (Terminal.app's > Settings/Report ....)) the user tells Terminal to let the app use the mou= se. > I find it little surprising that when Terminal.app does that, it doesn't > use the mouse itself to make a selection it could then copy. It does, although that's Terminal.app's "own" selection, not Emacs's. > Do Command-A Command-C and see what happens. > > Or use Command-R to toggle the mouse reporting setting on the fly. > > Or use xclip in Emacs. > > Please don't disable xterm-mouse for this. Again, it turns out that the new default leads to copy not working at all, while with previous default you could make selection in Terminal.app (it's not reflected in Emacs) and then copy. Paste works in both cases. It still looks to me that the old default is better. If you enable xterm-mouse-mode, then perhaps you should also use xclip, not just the mode itself.