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 15:54:24 -0500 Message-ID: References: <8634iszpa5.fsf@gnu.org> <86y10ky9wf.fsf@gnu.org> <86wmg4xd2u.fsf@gnu.org> <86y10jwmsb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c7c25a06292d0b2d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40267"; 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 21:57:34 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 1tMCj7-000ADh-O6 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Dec 2024 21:57:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMCih-00056u-UI; Fri, 13 Dec 2024 15:57: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 1tMCic-00056Y-Uf for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 15:57: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 1tMCic-0001cy-MC for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 15:57:02 -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=FyUH3mVwAvv028v1U2VMcVhAH5eCp5hyZ0IeLJtRAxs=; b=rgon9oHtTgARt3oypeNRN25ohl2GP9wjtQ73MRP0jmPFiosZJ9B1W0qB0P1DKcQIHW38Vx570DkuqjWYAvfBAC2z8HBlPbu8zdfQyS7ngDNi7XtdoNwCNacWPVt+SgRLJ5zhEWy58EiaL6h1xTRwK+0AE2Va89/nzUedqz3Eu8Y2fWoyc+A9NVyxfJqt/bLZxaKOI/C/C5TInh80cxB389om0AQaYZNYl3P/QyQzhf24kX5pRpWfeWisHD5O7A05efmuc+WLQcu69zczeLd9gtCvw7b+4fs++AQZ1/FGdaqswG876fC3g8JU+WSbpANLJ0cJ7f6yWiPey2zH0OA8/w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMCic-0003c1-Fm for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 15:57: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 20:57: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.173412339513836 (code B ref 74833); Fri, 13 Dec 2024 20:57:02 +0000 Original-Received: (at 74833) by debbugs.gnu.org; 13 Dec 2024 20:56:35 +0000 Original-Received: from localhost ([127.0.0.1]:44320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMCi7-0003b1-0Q for submit@debbugs.gnu.org; Fri, 13 Dec 2024 15:56:35 -0500 Original-Received: from mail-vs1-f53.google.com ([209.85.217.53]:60802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMCi1-0003aZ-1S for 74833@debbugs.gnu.org; Fri, 13 Dec 2024 15:56:29 -0500 Original-Received: by mail-vs1-f53.google.com with SMTP id ada2fe7eead31-4affab62589so450562137.1 for <74833@debbugs.gnu.org>; Fri, 13 Dec 2024 12:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734123308; x=1734728108; 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=FyUH3mVwAvv028v1U2VMcVhAH5eCp5hyZ0IeLJtRAxs=; b=kQypuVtHiinKMsNjSu/kLBsB3cQQSGIhD+vykY+qKGV++apehs+MTzP50MSUBItsnC 0AoyP2QNoL8c8UY+13Qlk9I39zgZIzmZniY8DhVSj2LOCpyO3LjXQppidUTwWb3pygTc BnsNlSXrzEKdrH9fnIdGrJjauHj+0A4UXqAWWjtv3PzArf0E8ShOR30h9vvQclHJDJMH 5j/IR6Iwl9487cg9UR4ZYzH6YpSzqW7nHASiWq4xxnXRrgfARGvYGwjxuwNS2nQGZfwQ 1mVu+QCfHI4dFzgAAcliqv4QG17a4qrtjuVK1dAo2OPYjbAIZL3YTrwRW1cbahnoz989 BqZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734123308; x=1734728108; 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=FyUH3mVwAvv028v1U2VMcVhAH5eCp5hyZ0IeLJtRAxs=; b=DtA+jcqI5EDwNMPAKgM/NaHvt+655qGiM9TEV5V2vjDAAtgemsQnkKhddQ54EI03yt LZejAriNEt5zAcRDAyHVtHY7iLoiYe1oMScA0jhSeNaUOjI2X653YBYrCzhxJZ1rahv/ WCJ6vpg/kGhwl3UoeJWuGy8iCFzvWNGhTq9evmEl4OQ+xY06x/Utf08x3dh7vkFPQt0y gWTlbloMBLasBaUAF7E6zX0oenZPv1U2vdvwRz0iXgTgYKqlEcQ6M8Md6QJ/aFVxr4Na jTPBKZQMFOJDp7eE+HAIDGBwDwn4dYK5rxlIu083bcWVVIq97TNCrTJvMZf9Xjj7f5B7 u1GQ== X-Forwarded-Encrypted: i=1; AJvYcCW61Ydi4ZqDo0PTz9KOPaGVW3z/Nlyj4flcAbMBBVoJ1NRF17x2wuvQAxwFiCjasW79TRC6bA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yx2E42E9XQbWQsQBQQvDHf/kaVzalUVlq7f+k8LUJs1ZQTKsVQn u3Fpz7y2EoeqjW9B2Mf/G8gFCP5K4pQks9v5mu5cKp3DWChSmjt59BZpp5Ob3jbau3UzmUaoZZn vMzxa/cIrW3PQqvxhbwzzw5itFNI= X-Gm-Gg: ASbGncsPGz7aBIreozPYNIu+/yS+YLdPQ7w9SBXLB8BPlkJcZxDBP6/Yu2jZtJR9Ra2 uf4d1fz1BMAMuNzvKSOcRX+zDYZPNAd0P3bw2EQ== X-Google-Smtp-Source: AGHT+IGCVCdAfgoFYXY4nZ6xS2fCuPcZ/CEsU3yk6lYVYCJ/9eTDyCmxGwOLuhMt/svNGjrFFte6U64niRkAKBixMLE= X-Received: by 2002:a05:6102:32c3:b0:4b2:484e:88b8 with SMTP id ada2fe7eead31-4b25dc4ea49mr4977524137.1.1734123308169; Fri, 13 Dec 2024 12:55:08 -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:296993 Archived-At: --000000000000c7c25a06292d0b2d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm afraid to say that TERM indicates terminfo support, not whether terminal.app provides full xterm compatibility which I believe it doesn't, at least not without manual modifications to the key maps and I can't speak to other xterm features. This will require some experimentation. Give xterm.el a try and see how it goes. I would not load that by default without conformance testing of some kind. I suppose it would already have been by now if it was known to work. Take a look at this page https://dotat.at/@/2020-12-12-terminal-app-xterm-compatibiity.html someone did some work in this regard. I might give some of this a try myself one day. On Fri, Dec 13, 2024 at 3:32=E2=80=AFPM Filipp Gunbin = wrote: > 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 somethin= g > >> > 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 i= s > >> 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 disab= le > >> 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? > > Terminal.app sets TERM=3Dxterm-256color (this is configurable in "Setting= s > -> 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 > --000000000000c7c25a06292d0b2d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm afraid to say that TERM indicates terminfo support, not whether = terminal.app provides full xterm compat= ibility which I believe it doesn't, at least not without manual modific= ations to the key maps and I can't speak to other=C2=A0xterm features. = This will require some experimentation. Give xterm.el a try and see how it = goes. I would not load that by default without conformance testing of some = kind. I suppose it would already have been by now if it was known to work.<= /div>

Take a look a= t this page=C2=A0https://dotat.at/@/2020-12-12-terminal-app-xterm-compa= tibiity.html someone did some work in this regard. I might give some of= this a try myself one day.

On Fri, Dec 13, 2024= at 3:32=E2=80=AFPM Filipp Gunbin <fgunbin@fastmail.fm> wrote:
On 13/12/2024 18:49 +0200, Eli Zaretskii wrote:

>> From: Filipp Gunbin <fgunbin@fastmail.fm>
>> Cc: Ship Mints <shipmints@gmail.com>,=C2=A0 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?=C2=A0 It sounds like the OP expe= cts something
>> > to happen which shouldn't, because the xterm protocol for= selections
>> > and the clipboard are not supported by Terminal.app?=C2=A0 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.=C2= =A0 This is
>> 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 enabl= ed, 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 jus= t doesn't
>> copy text to OS clipboard.=C2=A0 And it's non-obvious that you= should disable
>> 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.=C2=A0 Does Terminal.a= pp
> load xterm.el on startup?

Terminal.app sets TERM=3Dxterm-256color (this is configurable in "Sett= ings
-> Profiles -> Advanced -> Declare terminal as", I doubt I ev= er 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
--000000000000c7c25a06292d0b2d--