From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Ship Mints <shipmints@gmail.com>
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 11:47:27 -0500
Message-ID: <CAN+1Hbq8-N2AERkFTp8kQAe8U1kT8NC+hFhn3C6-OOoDOV2yRw@mail.gmail.com>
References: <f60142c9c903bf4e29776c6ede21f7d0@finder.org>
 <m2msgwfg8c.fsf@gmail.com>
 <535228fe493971e918ee22faeb58c433@finder.org> <86ttb3pos2.fsf@gnu.org>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="000000000000527aa6062965f29a"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="4167"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: gerd.moellmann@gmail.com, fgunbin@fastmail.fm, 74833@debbugs.gnu.org,
 Jared Finder <jared@finder.org>
To: Eli Zaretskii <eliz@gnu.org>
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: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1tNEIa-0000ro-MA
	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 <bug-gnu-emacs-bounces@gnu.org>)
	id 1tNEIH-0002K2-Um; Mon, 16 Dec 2024 11:50:06 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1tNEIG-0002Jg-JL
 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 <Debian-debbugs@debbugs.gnu.org>)
 id 1tNEIG-0004FD-3q
 for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 11:50:04 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=debbugs.gnu.org; s=debbugs-gnu-org; 
 h=Date:From:In-Reply-To:References:MIME-Version:To:Subject;
 bh=rbijqIfnVdIvZzGKEkJ8De2AuyHJ4hd4nycKTviaNqo=; 
 b=PtIuOIsu86NisykxI4qL+yQGLsqpCvLcAZDgv5wzfvzPoLaWYqxuwtqoeQT1dihRYn8d7KdS+/mH/rup66042jUI24v7e+4LKpo5qkU7EqLoSoUGtX6kz329pxwnBfBPWH/sV3r+pwt1q6hbeJi0ttGKU6I1JPLi2aY6Gtda3zZi5DR65HyrlsMbq1nuoDmXzmkSZDOLOxASVYLvoUx1f07/V9/uoEkjv2/PhRlrEvzyVdD0+aexfEN/DvuFBePQIzDsXLnYp07Z0R9bVejcybK47fzC5VhbfjMF2RdCkNGKhO4jMG3k5AJkLrQ7WCPm2oXNJwITON/KDitiiMmiww==;
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tNEIE-0003zU-Sf
 for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 11:50:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Ship Mints <shipmints@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Mon, 16 Dec 2024 16:50:02 +0000
Resent-Message-ID: <handler.74833.B74833.173436776215256@debbugs.gnu.org>
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.173436776215256
 (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:22 +0000
Original-Received: from localhost ([127.0.0.1]:55770 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1tNEHZ-0003xy-LC
 for submit@debbugs.gnu.org; Mon, 16 Dec 2024 11:49:22 -0500
Original-Received: from mail-vk1-f178.google.com ([209.85.221.178]:53408)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <shipmints@gmail.com>) id 1tNEHX-0003xS-Jc
 for 74833@debbugs.gnu.org; Mon, 16 Dec 2024 11:49:20 -0500
Original-Received: by mail-vk1-f178.google.com with SMTP id
 71dfb90a1353d-51640f7bbd3so1090570e0c.2
 for <74833@debbugs.gnu.org>; Mon, 16 Dec 2024 08:49:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1734367694; x=1734972494; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=rbijqIfnVdIvZzGKEkJ8De2AuyHJ4hd4nycKTviaNqo=;
 b=KvBiehW9PVN3wjZ+6Xynx+lMLDoTbrdM70cMR0cpGGOli4L8SNlvtIkNsC3+h+WH/J
 9gscKW6zzKBTVVmt0BXzUeMoh3clElK7fep4dRiKjpz2XY2b/3AA2b5JTy0B6XjniI0M
 niyRZyltIaDHNOm9hKmkW1pC+eVgP6VOmXrIps0vXK4SVDOP6CEPHIuGuIs1Ko3/WeQJ
 0aIp07RMWSHGom6BlXUmoYfO/U34gyXzeTs2JZLP0AW6oYl/aItZLu2igh8FfEmnuZi/
 nn/5Lh4c3GuYfAsW8tjoQzAsIeiXSY6Neo2KChEd5I5reUJTQayfBSUlk+FY555WLzYd
 eAtQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1734367694; x=1734972494;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=rbijqIfnVdIvZzGKEkJ8De2AuyHJ4hd4nycKTviaNqo=;
 b=k5/mPuyyF43K4Yd/HhsBFNcOmdGz+d844qv4FD8l87SkGBbvrA+pSaRSSAN4udWdye
 eljqnMDyQS5nHb3zKz/SeM2vrERf+Ppl2BoFgruDSllSgswDZ/f255zQ75dE08g3oEIQ
 EUXmT7trdK1jJzrHow9zSmMnEqvty9lAes8qeJCYrjDNNwt8boHcDV4DC9d7duaXd8fs
 KHUIiZpMFFTs3arJScaaJ70i1gJ4xULQ9UI5gf642+Ed0sEEfSz3vDq80vfm5kX3Ly9K
 8oh+c8vD4naCifAtMi88UEjvgLS/rksAQgDgBbQkvYqO9dE4qOKZHS8ycx9xaPNTK7mY
 IX2A==
X-Forwarded-Encrypted: i=1;
 AJvYcCUtJchtP/qbSzrFYNAiYaOfmyxvLP8feMzOe+aMWd8UTZzHIBx+QQZE9oiwySwS64Af88fDYw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yx0mAhpDJAtlsOATMhAo44SFapojiIIkKuUY/NjSMUrHllU3Hdy
 gNSYkZW+bt+z2a0nzcCOuMbGhKTgqoX5P99kv540qqf+rWAaZgSUqGsTDXvtMmOeVmrbiaZmqFM
 66brnHBdeqe5yyDwqb2tgwTz5QVM=
X-Gm-Gg: ASbGncuYYpdMGFJGuNpMDT/KDtdrCcWf/ZmK+A+wMZ3BCEMAaYzlRiMkV1HO/6tNucb
 eAZCamePZaNSRX5FRaP6xyB/SOHR0sFnv6SPWbQ==
X-Google-Smtp-Source: AGHT+IEBd8e6dbbjITu1aq8rFLA6N49Hp+XZQzjd9+YB5gCB+avElbAbUp+Tw1MtXMEXE5KMF99Cu3LnUpJcT9OLbIA=
X-Received: by 2002:a05:6122:8c27:b0:516:157c:a72e with SMTP id
 71dfb90a1353d-518ca2172femr12619462e0c.3.1734367694189; Mon, 16 Dec 2024
 08:48:14 -0800 (PST)
In-Reply-To: <86ttb3pos2.fsf@gnu.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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:297190
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/297190>

--000000000000527aa6062965f29a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I use xterm-mouse under Terminal.app just fine as I rely only on Emacs
pasteboard integration via xclip. (I use clipetty when terminals support
osc52--there's no easy programmatic test for that which I'm aware of so I
set that up "by hand.") I don't think it is a good idea to blanket disable
xterm-mouse for macOS users.

FWIW, one can detect it via getenv "TERM_PROGRAM" when set to "Apple_Termin=
al".
I'd suggest this is an exercise for the user. In my configuration, I have
various things I configure based on if macOS and the terminal program; one
being Apple's Terminal.app, another being WezTerm, etc.

On Mon, Dec 16, 2024 at 11:37=E2=80=AFAM Eli Zaretskii <eliz@gnu.org> wrote=
:

> > Date: Sun, 15 Dec 2024 21:16:16 -0800
> > From: Jared Finder <jared@finder.org>
> > Cc: Eli Zaretskii <eliz@gnu.org>, Filipp Gunbin <fgunbin@fastmail.fm>,
> >  74833@debbugs.gnu.org, shipmints@gmail.com
> >
> > On 2024-12-15 19:40, Gerd M=C3=B6llmann wrote:
> > > Jared Finder <jared@finder.org> writes:
> > >
> > >> What about adding a workaround that uses the command line tool pbcop=
y
> > >> (Mac version of xclip)? The pbcopy program is distributed with MacOS
> > >> by default.
> > >
> > > The Elpa package xclip uses that.
> > >
> > >   ;; This package allows Emacs to copy to and paste from the GUI
> > > clipboard
> > >   ;; when running in text terminal.
> > >   ;;
> > >   ;; It can use external command-line tools for that, which you may
> > > need
> > >   ;; to install in order for the package to work.
> >
> > Thanks. I just tested xclip-mode from Elpa and it indeed works to get
> > copy operations work with Terminal.app. I think the best path forward
> > would be to just mention this package in the NEWS update as a workaroun=
d
> > for folks using Terminal.app. We could also recommend using iTerm2 as a
> > GPL'd alternative that properly supports copy. (Paste works fine becaus=
e
> > Terminal.app supports xterm bracketed pastes.)
> >
> > Eli, does this sound good to you?
>
> It does (I think it should also be in PROBLEMS), but I wonder whether
> we should disable xterm-mouse on Terminal.app (assuming we can detect
> it).  It sounds like more people could bump into this tricky issue,
> and relying on all of them read NEWS is too optimistic.
>
> What are the downsides of turning this off for Terminal.app?  That's
> what Emacs before 31 had, so it cannot be too bad.
>

--000000000000527aa6062965f29a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D""><font face=3D"mono=
space">I use xterm-mouse under Terminal.app just fine as I rely only=C2=A0o=
n=C2=A0Emacs pasteboard integration via xclip. (I use=C2=A0clipetty when te=
rminals support osc52--there&#39;s no easy programmatic test for that which=
 I&#39;m aware of so I set=C2=A0that up &quot;by hand.&quot;) I don&#39;t t=
hink it is a good idea to blanket=C2=A0disable xterm-mouse for macOS users.=
</font></div><div class=3D"gmail_default" style=3D""><font face=3D"monospac=
e"><br></font></div><div class=3D"gmail_default" style=3D""><font face=3D"m=
onospace">FWIW, one can detect it via getenv &quot;TERM_PROGRAM&quot; when =
set to=C2=A0</font><span style=3D"font-family:monospace">&quot;Apple_Termin=
al&quot;. I&#39;d suggest this=C2=A0is an exercise for the user. In my conf=
iguration, I have various things I configure based on if macOS and the term=
inal program; one being Apple&#39;s Terminal.app, another being WezTerm, et=
c.</span></div></div><br><div class=3D"gmail_quote gmail_quote_container"><=
div dir=3D"ltr" class=3D"gmail_attr">On Mon, Dec 16, 2024 at 11:37=E2=80=AF=
AM Eli Zaretskii &lt;<a href=3D"mailto:eliz@gnu.org">eliz@gnu.org</a>&gt; w=
rote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0p=
x 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; Date:=
 Sun, 15 Dec 2024 21:16:16 -0800<br>
&gt; From: Jared Finder &lt;<a href=3D"mailto:jared@finder.org" target=3D"_=
blank">jared@finder.org</a>&gt;<br>
&gt; Cc: Eli Zaretskii &lt;<a href=3D"mailto:eliz@gnu.org" target=3D"_blank=
">eliz@gnu.org</a>&gt;, Filipp Gunbin &lt;<a href=3D"mailto:fgunbin@fastmai=
l.fm" target=3D"_blank">fgunbin@fastmail.fm</a>&gt;,<br>
&gt;=C2=A0 <a href=3D"mailto:74833@debbugs.gnu.org" target=3D"_blank">74833=
@debbugs.gnu.org</a>, <a href=3D"mailto:shipmints@gmail.com" target=3D"_bla=
nk">shipmints@gmail.com</a><br>
&gt; <br>
&gt; On 2024-12-15 19:40, Gerd M=C3=B6llmann wrote:<br>
&gt; &gt; Jared Finder &lt;<a href=3D"mailto:jared@finder.org" target=3D"_b=
lank">jared@finder.org</a>&gt; writes:<br>
&gt; &gt; <br>
&gt; &gt;&gt; What about adding a workaround that uses the command line too=
l pbcopy<br>
&gt; &gt;&gt; (Mac version of xclip)? The pbcopy program is distributed wit=
h MacOS<br>
&gt; &gt;&gt; by default.<br>
&gt; &gt; <br>
&gt; &gt; The Elpa package xclip uses that.<br>
&gt; &gt; <br>
&gt; &gt;=C2=A0 =C2=A0;; This package allows Emacs to copy to and paste fro=
m the GUI <br>
&gt; &gt; clipboard<br>
&gt; &gt;=C2=A0 =C2=A0;; when running in text terminal.<br>
&gt; &gt;=C2=A0 =C2=A0;;<br>
&gt; &gt;=C2=A0 =C2=A0;; It can use external command-line tools for that, w=
hich you may <br>
&gt; &gt; need<br>
&gt; &gt;=C2=A0 =C2=A0;; to install in order for the package to work.<br>
&gt; <br>
&gt; Thanks. I just tested xclip-mode from Elpa and it indeed works to get =
<br>
&gt; copy operations work with Terminal.app. I think the best path forward =
<br>
&gt; would be to just mention this package in the NEWS update as a workarou=
nd <br>
&gt; for folks using Terminal.app. We could also recommend using iTerm2 as =
a <br>
&gt; GPL&#39;d alternative that properly supports copy. (Paste works fine b=
ecause <br>
&gt; Terminal.app supports xterm bracketed pastes.)<br>
&gt; <br>
&gt; Eli, does this sound good to you?<br>
<br>
It does (I think it should also be in PROBLEMS), but I wonder whether<br>
we should disable xterm-mouse on Terminal.app (assuming we can detect<br>
it).=C2=A0 It sounds like more people could bump into this tricky issue,<br=
>
and relying on all of them read NEWS is too optimistic.<br>
<br>
What are the downsides of turning this off for Terminal.app?=C2=A0 That&#39=
;s<br>
what Emacs before 31 had, so it cannot be too bad.<br>
</blockquote></div>

--000000000000527aa6062965f29a--