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


Message #92 received at 74833 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: gerd.moellmann <at> gmail.com, fgunbin <at> fastmail.fm, 74833 <at> debbugs.gnu.org,
 Jared Finder <jared <at> finder.org>
Subject: Re: bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS
 Terminal.app with xterm-mouse-mode enabled
Date: Mon, 16 Dec 2024 11:47:27 -0500
[Message part 1 (text/plain, inline)]
I use xterm-mouse under Terminal.app just fine as I rely only on Emacs
pasteboard integration via xclip. (I use clipetty when terminals support
osc52--there's no easy programmatic test for that which I'm aware of so I
set that up "by hand.") I don't think it is a good idea to blanket disable
xterm-mouse for macOS users.

FWIW, one can detect it via getenv "TERM_PROGRAM" when set to "Apple_Terminal".
I'd suggest this is an exercise for the user. In my configuration, I have
various things I configure based on if macOS and the terminal program; one
being Apple's Terminal.app, another being WezTerm, etc.

On Mon, Dec 16, 2024 at 11:37 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Date: Sun, 15 Dec 2024 21:16:16 -0800
> > From: Jared Finder <jared <at> finder.org>
> > Cc: Eli Zaretskii <eliz <at> gnu.org>, Filipp Gunbin <fgunbin <at> fastmail.fm>,
> >  74833 <at> debbugs.gnu.org, shipmints <at> gmail.com
> >
> > On 2024-12-15 19:40, Gerd Möllmann wrote:
> > > Jared Finder <jared <at> finder.org> writes:
> > >
> > >> What about adding a workaround that uses the command line tool pbcopy
> > >> (Mac version of xclip)? The pbcopy program is distributed with MacOS
> > >> by default.
> > >
> > > The Elpa package xclip uses that.
> > >
> > >   ;; This package allows Emacs to copy to and paste from the GUI
> > > clipboard
> > >   ;; when running in text terminal.
> > >   ;;
> > >   ;; It can use external command-line tools for that, which you may
> > > need
> > >   ;; to install in order for the package to work.
> >
> > Thanks. I just tested xclip-mode from Elpa and it indeed works to get
> > copy operations work with Terminal.app. I think the best path forward
> > would be to just mention this package in the NEWS update as a workaround
> > for folks using Terminal.app. We could also recommend using iTerm2 as a
> > GPL'd alternative that properly supports copy. (Paste works fine because
> > Terminal.app supports xterm bracketed pastes.)
> >
> > Eli, does this sound good to you?
>
> It does (I think it should also be in PROBLEMS), but I wonder whether
> we should disable xterm-mouse on Terminal.app (assuming we can detect
> it).  It sounds like more people could bump into this tricky issue,
> and relying on all of them read NEWS is too optimistic.
>
> What are the downsides of turning this off for Terminal.app?  That's
> what Emacs before 31 had, so it cannot be too bad.
>
[Message part 2 (text/html, inline)]

This bug report was last modified 111 days ago.

Previous Next


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