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:49:03 +0300 Message-ID: References: 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="4222"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Gerd =?UTF-8?Q?M=C3=B6llmann?= , Eli Zaretskii , 74833@debbugs.gnu.org, shipmints@gmail.com To: Jared Finder Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 16 17:50:25 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 1tNEIa-0000s5-Q6 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Dec 2024 17:50:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNEIJ-0002K9-3V; Mon, 16 Dec 2024 11:50: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 1tNEIF-0002JR-SR for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 11:50:04 -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 1tNEIF-0004Bb-JD for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 11:50:03 -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=qWiuKf/Pn+vzBSG+LFnYYExHrKBtI1FMqGoK5CqCNZY=; b=jhT65ydE2VDS1y9RHo++CYiquk9r4F07feuJ6Q7ctfwGIYNdj8lwu2zjtzEhe5ub0IFdcYkdNTKoGyY2YbPgX/AzIFXTsywp8IyVxwsZAxOpUKWQUDmZ6xhZV56ZqAV76YN0Hn+Qq65to736BSuBzLZjOV+btdhhLigUXyvsUSSjEYrK7vElSkeUlxv7gnKUSVxI+fgO9CGWc+y7+mGBvm6/+fPx4yBnFAajzGUNaJ+2mPtpgnXL3GWffqaND6yGvxja6xeSKybYgJOG3u/AludUKBJageI9OkUmU9wP4lSlAtHT2ZMAv6bonet1RNTHmmuz20hVF+MRmsxfmpif2A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNEIE-0003zK-BG for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 11:50: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:50: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.173436775715234 (code B ref 74833); Mon, 16 Dec 2024 16:50:02 +0000 Original-Received: (at 74833) by debbugs.gnu.org; 16 Dec 2024 16:49:17 +0000 Original-Received: from localhost ([127.0.0.1]:55767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNEHV-0003xd-3w for submit@debbugs.gnu.org; Mon, 16 Dec 2024 11:49:17 -0500 Original-Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]:35149) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNEHR-0003xE-Ug for 74833@debbugs.gnu.org; Mon, 16 Dec 2024 11:49:15 -0500 Original-Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id 35CCF2540113; Mon, 16 Dec 2024 11:49:07 -0500 (EST) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Mon, 16 Dec 2024 11:49:07 -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=1734367747; x=1734454147; bh=qWiuKf/Pn+vzBSG+LFnYYExHrKBtI1FMqGoK5CqCNZY=; b= mK8VdQlAqVvRoeB05BnZyStqociyZiHA49Lby398NAtUKQr82afI98Sf8x+YYBcs p0MPkTw0wqC12iwNTmIVYFIvsFltc+E6yTijm0FDtvEg1+q438Q/NOzMzB25u7n9 9LVr0bCRk9L2I+q1feb08r2/cXO8s9hmgN8LqgGGOJrLiQ9YllHORRWROxCO5WRE LbZuJrgMseo12havwpVU2ZKWuF27WVKTwFmFkjlBJSFlMPG6GH/pdDDeS5ETTA7T ci4Lcv/uU3LSRVbxDlCnjk3oiBH1WgVay064kiNyI6BpAOM4KLXnmvPk8raaMAvr eQvH4AjgQ2cCuzyzaWWi6g== 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=1734367747; x= 1734454147; bh=qWiuKf/Pn+vzBSG+LFnYYExHrKBtI1FMqGoK5CqCNZY=; b=F /chYcjkxR57DdR9DI/csEQM4BdJU5Nuv/xG/shZjDglVE/5yChw9jT6Xh7L0O2QD wGU0kuidbhQMScfj1zFdpjAe35r28tjQA9KT8GAMa8jq0BH/KToA40oP1BUd/TuI zjeckZzGkj4wIb4bro0SdhFVohmGCw3+IrXVjHV/gpkdodZ40JpwDSTbfqxJZM34 zebsWiXdij42tjc3yVnRMpb5nVyQ91JEjs5BmA94RQSaOkXFXT2jM4nO/NsSy7de DvCb2HyCzsnmWqhzCdRitnOZjAwJfoAmP8ID7kH72fjLda6TuvXOdZbltSUfNbRe E3gA7+YutrMrFtJ7CbBVw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrleefgdelfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufgjfhgffffkgggtgfesthhqredttderjeen ucfhrhhomhephfhilhhiphhpucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhmrg hilhdrfhhmqeenucggtffrrghtthgvrhhnpeefleefffetieetuedvtedtgfehgeevtefh ueevjeehjeelueeigfevtdeihfeugeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehfghhunhgsihhnsehfrghsthhmrghilhdrfhhmpdhnsggp rhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehshhhiphhmih hnthhssehgmhgrihhlrdgtohhmpdhrtghpthhtohepjeegkeeffeesuggvsggsuhhgshdr ghhnuhdrohhrghdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhope hgvghrugdrmhhovghllhhmrghnnhesghhmrghilhdrtghomhdprhgtphhtthhopehjrghr vggusehfihhnuggvrh X-ME-Proxy: Feedback-ID: id48c41f1:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Dec 2024 11:49:05 -0500 (EST) In-Reply-To: (Jared Finder's message of "Sun, 15 Dec 2024 17:41:01 -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:297191 Archived-At: On 15/12/2024 17:41 -0800, Jared Finder wrote: > On 2024-12-14 04:40, Gerd M=C3=B6llmann wrote: >> Eli Zaretskii writes: >>=20 >>>> From: Filipp Gunbin >>>> Cc: shipmints@gmail.com, 74833@debbugs.gnu.org >>>> Date: Fri, 13 Dec 2024 23:32:39 +0300 >>>> On 13/12/2024 18:49 +0200, Eli Zaretskii wrote: >>>> >> 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 somet= hing >>>> >> > to happen which shouldn't, because the xterm protocol for selecti= ons >>>> >> > and the clipboard are not supported by Terminal.app? In that cas= e, >>>> >> > 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. Thi= s is >>>> >> not integration with Emacs kill ring, no. Emacs cursor does not re= act >>>> >> 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 enable= d, so >>>> >> I did some testing just out of curiosity. Most of the things work, >>>> >> including clicking and selection. However, Command-C now just does= n't >>>> >> copy text to OS clipboard. And it's non-obvious that you should di= sable >>>> >> xterm-mouse-mode to be able to copy. >>>> > >>>> > xterm-mouse-mode is supposed to be enabled only on terminals that lo= ad >>>> > xterm.el, which means they are xterm-compatible. Does Terminal.app >>>> > load xterm.el on startup? >>>> Terminal.app sets TERM=3Dxterm-256color (this is configurable in >>>> "Settings >>>> -> Profiles -> Advanced -> Declare terminal as", I doubt I ever >>>> changed >>>> it), so xterm.el should be loaded, yes. >>>> Other term-related vars are: >>>> 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. > > I agree. While in Emacs, with Emacs managing the selection, one should > expect to use Emacs commands to manage the clipboard like C-w and > M-w. Sadly, Terminal.app does not support OSC52 therefore the > clipboard is shared only within Emacs. Terminal.app provides fn+mouse > drag to select things that Command-C notices as well as Command-R to > disable mouse reporting already for exactly this reason. I didn't know about fn + mouse drag, thanks! > However, I'm sensitive that someone using Terminal.app is just using > the MacOS default configuration for terminal and will think Emacs is > broken here. Terminal.app is MacOS's default terminal emulator after > all. That's my point, yes. > Other popular MacOS terminal emulators like iTerm2 work fine > because they support OSC52 (copy protocol). > > What about adding a workaround that uses the command line tool pbcopy > (Mac version of xclip)? The pbcopy program is distributed with MacOS > by default. This won't work over SSH, but at that point I don't think > there's anything that can be done. TERM_PROGRAM isn't sent to the > server by default. Having thing like that in Emacs, without a need for installing a package, would be best from my POV. > I also think I could make the news entry more detailed. > > > Paste works just fine in MacOS under Terminal.app for me. For me too.