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

From: Jared Finder <[email-masked]>
Date: Wed, 18 Dec 2024 21:16:16 -0800

On 2024-12-18 09:50, Ship Mints wrote:
> On Tue, Dec 17, 2024 at 1:32 PM Eli Zaretskii <[email-masked]> wrote:
>> I don't see how this distinction (which I have no doubt is accurate)
>> is important to the decision we should make here.  Simply put,
>> "something" that worked on Terminal.app before we turned on xt-moude
>> doesn't work in some cases after we turned it on.  That's my bother.
> I see your point, Eli, for sure. Since this is on master, and 
> presumably destined for Emacs 31, there seems to be sufficient time for 
> people to read NEWS and PROBLEMS and accommodate their configurations 
> while Emacs is brought one step forward into behaving, by default, like 
> other terminal apps on macOS.
> 
> 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).

   -- MJF