GNU bug report logs - #74833
31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled

Previous Next

Package: emacs;

Reported by: Filipp Gunbin <fgunbin <at> fastmail.fm>

Date: Thu, 12 Dec 2024 17:56:02 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jared Finder <jared <at> finder.org>
To: Ship Mints <shipmints <at> gmail.com>
Cc: Gerd Möllmann <gerd.moellmann <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, fgunbin <at> fastmail.fm, 74833 <at> debbugs.gnu.org
Subject: bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled
Date: Fri, 20 Dec 2024 10:48:18 -0800
On 2024-12-19 09:23, Ship Mints wrote:
> On Thu, Dec 19, 2024 at 6:16 AM Jared Finder <jared <at> finder.org> wrote:
>> On 2024-12-18 09:50, Ship Mints wrote:
>>> 
>>> I think someone suggested bringing xclip (seems properly licensed) 
>>> into
>>> the core and now might be a good time to consider that.
>> 
>> This seems like a good idea to me too. I think we'd also want a 
>> variable
>> to disable auto-enabling xclip-mode (let's call it
>> "xterm-enable-xclip-fallback" and assume it defaults to t). So when
>> Emacs detects it is running in Terminal.app and
>> xterm-enable-xclip-fallback is set, it enables xclip-mode. In all 
>> other
>> cases, no change is made.
>> 
>> This does still result in a user-facing behavior change: instead of
>> pressing Command-c, a user would have to press Emacs' key binding, M-w
>> (or C-c if cua-mode is enabled).
>> 
> I took a look at xclip's code, and its scope is larger than just macOS 
> pasteboard integration. If I volunteered to help adopt xclip into 
> Emacs, I'd have no easy way to test its scope beyond macOS. Perhaps it 
> should remain an external package and people just install when needed. 
> Equivalent mac-specific pasteboard integration could live in ns-win.el 
> and be narrower in scope just for macOS users.

I tried a handful of terminal in Linux and it appears that while the 
majority support OSC 52, a significant amount of them don't. The biggest 
gap is all the vte based ones like Gnome Terminal or XFCE Terminal. 
These are their windowing system's default terminals, so there's likely 
a lot of usage here.

If we want to ensure mouse drag to highlight, copy within the terminal 
Emacs, followed by a paste outside of the terminal still work we would 
need to bring xclip into core. I think this would be generally good to 
do anyways. I didn't know about the xclip package and it would have 
significantly improved my workflows with xterm-mouse-mode. I suspect 
many other users of xterm-mouse-mode are in the same boat.

  -- MJF




This bug report was last modified 159 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.