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: Fri, 13 Dec 2024 11:42:06 -0500 Message-ID: References: <8634iszpa5.fsf@gnu.org> <86y10ky9wf.fsf@gnu.org> <86wmg4xd2u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006cf1da06292985a2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29640"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 74833@debbugs.gnu.org To: Filipp Gunbin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 13 17:45:42 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 1tM8nN-0007UV-9l for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Dec 2024 17:45:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tM8mq-0007Gf-CP; Fri, 13 Dec 2024 11:45:08 -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 1tM8mm-0007Fy-Mk for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 11:45: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 1tM8mm-0007as-0i for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 11:45: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=hgLnQ9yP7q/Sy34OZiUdZypUNZTBKb/6x+kc7RRiyIQ=; b=WAjOPm483vZW2cp8DM/UVbZgONJmQS6GqEbWiAnJ08kTxg9PiP/AA0zUneIBIOwDESbnQVxL7MeOzPQnVRk8rPRLb09BQCXFGwosJL+FErqPV+3wvOmDnS/w6sqJru2HehtmvhzrLb83/nWJGVdwRVP7ybyFBZTF9kuRLNs/QLEEMzAs4wL3uiEdPUYLQW8hnhnBqM2YOFY1kIwtmImDSuCQ595H99nxRjLMj7GpeycHOYAdccF8dfpy0F2Ep/uVREAZq0akZb9az8c2unkfDmCLT8eXCJoJllhXjCydLQVKj9dNePxpja+KoO1P80TrbeYELnvgseyh+1tooE3IIg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tM8mk-00083y-KZ for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 11:45: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: Fri, 13 Dec 2024 16:45: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.173410824230865 (code B ref 74833); Fri, 13 Dec 2024 16:45:02 +0000 Original-Received: (at 74833) by debbugs.gnu.org; 13 Dec 2024 16:44:02 +0000 Original-Received: from localhost ([127.0.0.1]:43933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tM8li-00081F-8R for submit@debbugs.gnu.org; Fri, 13 Dec 2024 11:44:02 -0500 Original-Received: from mail-vk1-f181.google.com ([209.85.221.181]:49337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tM8le-00080y-Qb for 74833@debbugs.gnu.org; Fri, 13 Dec 2024 11:43:56 -0500 Original-Received: by mail-vk1-f181.google.com with SMTP id 71dfb90a1353d-5187aa2c97dso552147e0c.2 for <74833@debbugs.gnu.org>; Fri, 13 Dec 2024 08:43:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734108169; x=1734712969; 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=hgLnQ9yP7q/Sy34OZiUdZypUNZTBKb/6x+kc7RRiyIQ=; b=HdrAB3i3Bb1D6XbFQF6TRm881HAaClVoSsib0DgghHfo/B1eVHwmSoJoM40CtGZevj PffYGhcZyTAMHKnRB9gAS+QTrxqe8CRnm51pOysZ9+p42f5zqyiD1THRd5gQIhA3rEo3 VylkpHozCApfakzDojdPsFem6uD0ICHN1GlvNpSH1QNhW2xShNbAwHUwoD55KvUN04q/ c3E35cW9fz+FGE1GhU4wdF6laugFnh1nI25UvRQSLib/6XRTgG3WZMyj4MzHaBnKO96s qWTQY5er1iReLR3I3otfbcL93zfqKRyL2YtVqUezdZDr0wKxlILRFgMI8MEteQYHzNJd aT2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734108169; x=1734712969; 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=hgLnQ9yP7q/Sy34OZiUdZypUNZTBKb/6x+kc7RRiyIQ=; b=C+AOWc3JKsBoDRcFTo9FKMpBhXgh6dd0AHjy8dlmtS7BMOQNunk5hW5VQYzk8xBBwE 0+NX4a6ZrdVkLq48lSLi6VrbPxxb+RXhn/a08/5qBVEdnrfjipAYlC61UJETHU1IYX7U 6tXCG8rbaq6+oW6X1AtAPFPomnviqwJSWJs78iX4fF4SAY0Rs/jiaqJAuOhRJ5pH6EKW eSrUo/Vz14Jh2V5xsp/kdOXp3OQcHNUeH76PA7B3t592GhJd66OmVz4otR7MoGUQK+F5 q/a9LgbSp06B0kOBXGAetJTsubbgf1htjT5H7MTYuNlOMp4LqLDydb8KGajUgbSZ28+N jB6g== X-Forwarded-Encrypted: i=1; AJvYcCXICuRtYxGgXqjQvBFk2kylhwr6sxUkcr/i0Ye/xdP5xefql0j5NsE5N9kEITUCkjAcJWTwSw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy9SUi8+J3BzrvqIfOyHUAP6JufUSeZ72IQZ4NnE3Qjh/iUH37+ wLUU1GyafdCy33+8+oJBRa2KFlzkzMpMsSdQvZ1KFWrYlnWZozJt9LD8BcAsWVuroU2vFndGtBi dDrKu6V+dO68+sxZkK3oEqLuoUAs= X-Gm-Gg: ASbGnctKFnf2dzzMpSV14TRhFq8l44wfCiRx9vZRCiMeUbj8m/xCtjjw+s3HZcmSu1m qTqR/6nzOD69IoVKbWQoAipmX2VpYFquSkYDZZg== X-Google-Smtp-Source: AGHT+IGcLTALX33Q7x+BYEE4NpssSY83ldjFJYmdLxzKgamThlJzUieYOXP4zJ/ubTY8PriPWO1tSbSRIcPUIrvMH5k= X-Received: by 2002:a05:6122:91e:b0:515:e446:b9f9 with SMTP id 71dfb90a1353d-518ca48f016mr3477722e0c.12.1734108169169; Fri, 13 Dec 2024 08:42:49 -0800 (PST) In-Reply-To: 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:296983 Archived-At: --0000000000006cf1da06292985a2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable What you describe is normal behavior, even if it appears confusing. It's an "impedance mismatch" between terminal.app and being in a "curses" window. Terminal doesn't "see" selected text and hence Command-C is disabled. This is the opposite for a basic shell where terminal sees the text because it controls selection. You can see this by pulling down the Edit menu and seeing Copy grayed out. As far as how xterm-mouse-mode interferes with Command-C I'd have to disable it myself and see what's going on. Not sure how much value that adds, though. If you enable xclip, you'll get what you want being inside Emacs, after all, using M-w gets your selected text copied to the pasteboard. On Fri, Dec 13, 2024 at 11:35=E2=80=AFAM Filipp Gunbin wrote: > On 13/12/2024 09:21 +0200, Eli Zaretskii wrote: > > >> From: Ship Mints > >> Date: Thu, 12 Dec 2024 15:31:00 -0500 > >> Cc: fgunbin@fastmail.fm, 74833@debbugs.gnu.org > >> > >> I have xterm-mouse-mode enabled when in tty mode on macOS and it does > work for clicking/selecting but > >> this is independent of integrating the kill ring with the pasteboard. = I > am unaware of how to test the > >> completeness of the xterm mouse protocol support, however. > > > > So why is this an Emacs bug? It sounds like the OP expects something > > to happen which shouldn't, because the xterm protocol for selections > > 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 react > 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 disable > xterm-mouse-mode to be able to copy. > > That's why I filed this bug - because previous behavior was not ideal > but working, and now only paste works. > > Maybe we should just avoid enabling xterm-mouse-mode in Terminal.app. > Maybe functionality of xclip should be in core. > --0000000000006cf1da06292985a2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
What you describe is normal behavior, even if it appears confusing. It&#= 39;s an "impedance mismatch" between terminal.app and being in a "curses" window. Terminal doe= sn't "see" selected text and hence Command-C is disabled. Thi= s is the opposite for a basic shell where terminal sees the text because it= =C2=A0controls selection. You can see this by pulling down the Edit menu an= d seeing Copy grayed out. As far as how xterm-mouse-mode interferes with Co= mmand-C I'd have to disable it myself and see what's going on. Not = sure how much value that adds, though. If you enable xclip, you'll get = what you want being inside Emacs, after all,=C2=A0using M-w gets your selec= ted text copied to the pasteboard.

On Fri, Dec 1= 3, 2024 at 11:35=E2=80=AFAM Filipp Gunbin <fgunbin@fastmail.fm> wrote:
On 13/12/2024 09:21 +0200, Eli Zaretskii wrote= :

>> From: Ship Mints <shipmints@gmail.com>
>> Date: Thu, 12 Dec 2024 15:31:00 -0500
>> Cc: fgunb= in@fastmail.fm, 74833@debbugs.gnu.org
>>
>> I have xterm-mouse-mode enabled when in tty mode on macOS and it d= oes work for clicking/selecting but
>> this is independent of integrating the kill ring with the pasteboa= rd. I am unaware of how to test the
>> completeness of the xterm mouse protocol support, however.
>
> So why is this an Emacs bug?=C2=A0 It sounds like the OP expects somet= hing
> to happen which shouldn't, because the xterm protocol for selectio= ns
> and the clipboard are not supported by Terminal.app?=C2=A0 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.=C2=A0 This i= s
not integration with Emacs kill ring, no.=C2=A0 Emacs cursor does not react=
to mouse clicks, and selection happens with OS mouse pointer.=C2=A0 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.=C2=A0 Most of the things work, including clicking and selection.=C2=A0 However, Command-C now just doesn&#= 39;t
copy text to OS clipboard.=C2=A0 And it's non-obvious that you should d= isable
xterm-mouse-mode to be able to copy.

That's why I filed this bug - because previous behavior was not ideal but working, and now only paste works.

Maybe we should just avoid enabling xterm-mouse-mode in Terminal.app.
Maybe functionality of xclip should be in core.
--0000000000006cf1da06292985a2--