From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jared Finder via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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, 27 Dec 2024 23:08:27 -0800 Message-ID: <5e102d7d29eba618874c0b41e9815b8d@finder.org> References: <8634iszpa5.fsf@gnu.org> <86y10ky9wf.fsf@gnu.org> <86wmg4xd2u.fsf@gnu.org> <86y10jwmsb.fsf@gnu.org> <86ldwiwvjc.fsf@gnu.org> <86ed27pfhj.fsf@gnu.org> <86a5cvpeiv.fsf@gnu.org> <86y10eo5h6.fsf@gnu.org> <986a3eea465e13c57bcdd7ce8f27f99d@finder.org> <864j2w6tz0.fsf@gnu.org> <861pxy5zxk.fsf@gnu.org> <86jzbq4i6x.fsf@gnu.org> <86frme4exq.fsf@gnu.org> <865xn5y2n0.fsf@gnu.org> Reply-To: Jared Finder Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16905"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, 74833@debbugs.gnu.org, fgunbin@fastmail.fm, shipmints@gmail.com, rms@gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 28 08:09:26 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 1tRQwu-0004Dm-BS for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Dec 2024 08:09:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRQwc-0008WP-Es; Sat, 28 Dec 2024 02:09: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 1tRQwY-0008W3-Nj for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 02:09:03 -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 1tRQwY-0007mv-Fo for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 02:09:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:MIME-Version:To:Subject; bh=KJn6uNIvWJkEkiC1gHZX9nEyZ9kaOpJoGTZnglxBsdk=; b=Bbm9CQ2PfbLBS4oYVQ6a1Ul9g+Coj7MNa2CFNsgICkMViwcaVFaDln5ODgt97MnqxPYw2ICr4vuDJldPyLk0Wa+g4KMaA8KuPWjVChBsWQNUEnXZZ/g+mkz42t+HUj1m8PfHLRbPk/EqNEhmCp5JlVHOpA9114+hKupnSp1z9WBxO4lT9WutRvDhh8Gkb54i+fEh5TYygJ0l/tocTUBSrrBOtZjjPSu/6vdMCo4/sQ8nACxm8tc48/1D9IquURcYtU3gciWhQe2DKfDl94nKenT+5LJW9UGBhFuu+KBaBipCJLjg5P9hRxDgT140g/IZbcBOGGwNg1YIpw25fX2MrQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tRQwY-00042u-2G for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 02:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jared Finder Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Dec 2024 07:09: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.173536971215514 (code B ref 74833); Sat, 28 Dec 2024 07:09:02 +0000 Original-Received: (at 74833) by debbugs.gnu.org; 28 Dec 2024 07:08:32 +0000 Original-Received: from localhost ([127.0.0.1]:48537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRQw3-000429-AX for submit@debbugs.gnu.org; Sat, 28 Dec 2024 02:08:31 -0500 Original-Received: from greenhill.hpalace.com ([192.155.80.58]:46210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRQw0-000420-A7 for 74833@debbugs.gnu.org; Sat, 28 Dec 2024 02:08:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=finder.org; s=2018; t=1735369707; bh=kPI09MiABmnNDcQS0yiTXdV8Ec0BbhEJZwsIBDGfUC0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uGSEc9uiITd6zQwOGY/c1XegSWsvNAZuoJpezyPveBY8FNFK4FVbkLwFPqKTPUiM2 eOo25pShLmXgj/oB+uYbOI/aD0CN/lvgczwGC9yrYmlf6Vaas4PH165+pW7fKqxudJ AvrSlPJNfXiITHFnxeoqdIomf6hQnRNvDT0DXh57RtOpVD5ivi5xqAjbrwc/2EYUMt mKJwjuegaECaiF67g2MemWrHwzzmEQ8leHgqgtN6B1bk7TEaCqHL9o89vGvGK4bTvB C582YRtTNtqpfYCAb6eX8NDbacvBqIMvvTmOhU8HY4uP+XxULArUZYLOpSwuVoXt/N J4dmUWz8JEOBA== Original-Received: from mail.finder.org (unknown [192.155.80.58]) by greenhill.hpalace.com (Postfix) with ESMTPSA id 6F9DD2A0B; Sat, 28 Dec 2024 07:08:27 +0000 (UTC) In-Reply-To: <865xn5y2n0.fsf@gnu.org> X-Sender: jared@finder.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:297852 Archived-At: On 2024-12-27 00:02, Eli Zaretskii wrote: >> Date: Thu, 26 Dec 2024 15:51:14 -0800 >> From: Jared Finder >> Cc: Eli Zaretskii , rms@gnu.org, >> gerd.moellmann@gmail.com, >> fgunbin@fastmail.fm, 74833@debbugs.gnu.org >> >> On 2024-12-23 11:43, Ship Mints wrote: >> > On Mon, Dec 23, 2024 at 4:07 PM Eli Zaretskii wrote: >> >>> From: Ship Mints >> >>> >> >>> Away from a computer, but I think this is still the same in 0.82 >> >>> these days and I assume you're using modern >> >>> ssh. >> >>> >> >>> https://serverfault.com/a/819740 >> >> >> >> OK, so does this mean we want to tell PuTTY users to configure this in >> >> some specific way that Emacs can recognize? >> > >> > Still away from a computer. If you can set a variable using that method >> > and have it pass through for you to test in lisp, then it would be a >> > good idea to recommend. We could suggest using TERM_PROGRAM and setting >> > it to "Putty". >> >> What if we only auto-enabled xterm-mouse-mode on OSC52 compatible >> terminals? > > On OSC52 compatible terminals, or on OSC52 compatible terminals that > define TERM to xterm-like string? The latter sounds like a good idea > to me, but only if support for OSC52 necessarily means xterm-mouse > escape sequences must be supported. Is this conjecture indeed true? I'm proposing Emacs have a manually curated allow list for now for auto-enabling xterm-mouse-mode. Being OSC52 compatible gets us the copy / paste issue this bug mentioned. We can add other conditions going forward. >> Between $TERM and the results from the terminal escape >> sequence "ESC [ > 0 q", Emacs can have high confidence if it is >> running >> on an OSC52 compatible terminal. I checked against most of the >> terminals >> mentioned at >> https://can-i-use-terminal.github.io/features/osc52copy.html I just >> wasn't able to test Foot (Wayland-only), hterm (Chromebook-only), >> mintty >> (Cygwin-only), or xterm.js (I have no idea how to test). > > How do I check this? can you show some script or Lisp or whatever you > used to check? Run the following lisp code in Emacs: (progn (send-string-to-terminal "\e[>0q") (let ((str "") chr) (while (setq chr (xterm--read-event-for-query)) (setq str (concat str (string chr)))) str)) You should get the string "\eP>|terminal name and version\e\\". For example, under iTerm2 I get iTerm2 3.5.10 as the terminal name and version and under Kitty I get kitty(0.38.1). -- MJF