From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ship Mints 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: References: <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 To: Eli Zaretskii 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-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 ) 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 ) 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 ) 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 ) 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 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.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 ) 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 ) 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" 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:297190 Archived-At: --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 wrote= : > > Date: Sun, 15 Dec 2024 21:16:16 -0800 > > From: Jared Finder > > Cc: Eli Zaretskii , Filipp Gunbin , > > 74833@debbugs.gnu.org, shipmints@gmail.com > > > > On 2024-12-15 19:40, Gerd M=C3=B6llmann wrote: > > > Jared Finder 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
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's no easy programmatic test for that which= I'm aware of so I set=C2=A0that up "by hand.") I don't t= hink it is a good idea to blanket=C2=A0disable xterm-mouse for macOS users.=

FWIW, one can detect it via getenv "TERM_PROGRAM" when = set to=C2=A0"Apple_Termin= al". I'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's Terminal.app, another being WezTerm, et= c.

<= div dir=3D"ltr" class=3D"gmail_attr">On Mon, Dec 16, 2024 at 11:37=E2=80=AF= AM Eli Zaretskii <eliz@gnu.org> w= rote:
> 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>,
>=C2=A0 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 too= l pbcopy
> >> (Mac version of xclip)? The pbcopy program is distributed wit= h MacOS
> >> by default.
> >
> > The Elpa package xclip uses that.
> >
> >=C2=A0 =C2=A0;; This package allows Emacs to copy to and paste fro= m the GUI
> > clipboard
> >=C2=A0 =C2=A0;; when running in text terminal.
> >=C2=A0 =C2=A0;;
> >=C2=A0 =C2=A0;; It can use external command-line tools for that, w= hich you may
> > need
> >=C2=A0 =C2=A0;; 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 workarou= nd
> for folks using Terminal.app. We could also recommend using iTerm2 as = a
> GPL'd alternative that properly supports copy. (Paste works fine b= ecause
> 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).=C2=A0 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?=C2=A0 That'= ;s
what Emacs before 31 had, so it cannot be too bad.
--000000000000527aa6062965f29a--