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

From: Eli Zaretskii <[email-masked]>
Date: Mon, 16 Dec 2024 18:30:53 +0200

> From: Gerd Möllmann <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  Filipp Gunbin <[email-masked]>,
>   [email-masked],  [email-masked]
> Date: Mon, 16 Dec 2024 04:40:03 +0100
> 
> Jared Finder <[email-masked]> 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.
>   ;; More specifically, it can use the following tools:
>   ;; - Under X11: `xclip' or `xsel' (https://xclip.sourceforge.net and
>   ;;   https://www.vergenet.net/~conrad/software/xsel/ respectively).
>   ;; - MacOS: `pbpaste/pbcopy'
>   ;; - Cygwin: `getclip/putclip'
>   ;; - Under Wayland: `wl-clipboard' (https://github.com/bugaevc/wl-clipboard)
>   ;; - Termux: `termux-clipboard-get/set'
>   ;; - Emacs: It can also use Emacs's built-in GUI support to talk to the GUI.
>   ;;   This requires an Emacs built with GUI support.
>   ;;   It uses `make-frame-on-display' which has been tested to work under X11,
>   ;;   but it's not known whether it works under MacOS or Windows.

It is not needed on Windows (at least the latest versions of it).