unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled
@ 2024-12-12 17:54 Filipp Gunbin
  2024-12-12 18:08 ` Ship Mints
  2024-12-12 19:15 ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: Filipp Gunbin @ 2024-12-12 17:54 UTC (permalink / raw)
  To: 74833

macOS, Terminal.app, xterm-mouse-mode enabled
emacs -nw -Q
Select something with mouse, press Command-c
Try to paste into another program - text is not in the clipboard

Perhaps this is not new, I just tried xterm-mouse-mode for the first
time, given that it's now the default in master.

Trying different combinations of select-enable-clipboard and
select-enable-primary did not help (that variables are all I know in
this area).

Thanks.


In GNU Emacs 31.0.50 (build 43, aarch64-apple-darwin23.6.0, NS
 appkit-2487.70 Version 14.6 (Build 23G80)) of 2024-12-12 built on
 localhost
Repository revision: 9ccd459e8452cc9e6e81e53f26bbeef20d2d5bb7
Repository branch: master
System Description:  macOS 14.6

Configured using:
 'configure --enable-check-lisp-object-type --with-file-notification=no
 --with-native-compilation=no'

Configured features:
ACL GLIB GNUTLS LCMS2 LIBXML2 MODULES NS PDUMPER PNG RSVG SQLITE3
THREADS TOOLKIT_SCROLL_BARS WEBP XIM ZLIB





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled
  2024-12-12 17:54 bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled Filipp Gunbin
@ 2024-12-12 18:08 ` Ship Mints
  2024-12-12 18:18   ` Filipp Gunbin
  2024-12-12 19:15 ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Ship Mints @ 2024-12-12 18:08 UTC (permalink / raw)
  To: 74833

[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]

You need something like https://elpa.gnu.org/packages/xclip.html to assist
connecting macOS terminal Emacs to the system pasteboard/clipboard.

On Thu, Dec 12, 2024 at 12:56 PM Filipp Gunbin <fgunbin@fastmail.fm> wrote:

> macOS, Terminal.app, xterm-mouse-mode enabled
> emacs -nw -Q
> Select something with mouse, press Command-c
> Try to paste into another program - text is not in the clipboard
>
> Perhaps this is not new, I just tried xterm-mouse-mode for the first
> time, given that it's now the default in master.
>
> Trying different combinations of select-enable-clipboard and
> select-enable-primary did not help (that variables are all I know in
> this area).
>
> Thanks.
>
>
> In GNU Emacs 31.0.50 (build 43, aarch64-apple-darwin23.6.0, NS
>  appkit-2487.70 Version 14.6 (Build 23G80)) of 2024-12-12 built on
>  localhost
> Repository revision: 9ccd459e8452cc9e6e81e53f26bbeef20d2d5bb7
> Repository branch: master
> System Description:  macOS 14.6
>
> Configured using:
>  'configure --enable-check-lisp-object-type --with-file-notification=no
>  --with-native-compilation=no'
>
> Configured features:
> ACL GLIB GNUTLS LCMS2 LIBXML2 MODULES NS PDUMPER PNG RSVG SQLITE3
> THREADS TOOLKIT_SCROLL_BARS WEBP XIM ZLIB
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 1778 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled
  2024-12-12 18:08 ` Ship Mints
@ 2024-12-12 18:18   ` Filipp Gunbin
  2024-12-12 18:20     ` Ship Mints
  0 siblings, 1 reply; 9+ messages in thread
From: Filipp Gunbin @ 2024-12-12 18:18 UTC (permalink / raw)
  To: Ship Mints; +Cc: 74833

On 12/12/2024 13:08 -0500, Ship Mints wrote:

> You need something like https://elpa.gnu.org/packages/xclip.html to assist
> connecting macOS terminal Emacs to the system pasteboard/clipboard.

Thanks, BTW paste with Command-V works, it's just copy that doesn't
work.  Probably I'll disable xterm-mouse-mode anyway, but it would be
nice to have this resolved in Emacs.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled
  2024-12-12 18:18   ` Filipp Gunbin
@ 2024-12-12 18:20     ` Ship Mints
  0 siblings, 0 replies; 9+ messages in thread
From: Ship Mints @ 2024-12-12 18:20 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 74833

[-- Attachment #1: Type: text/plain, Size: 702 bytes --]

I think that's because Terminal.app is providing paste, not Emacs. If you
use Emacs commands to put text into the kill-ring, it has to make it from
there into the pasteboard/clipboard and that's what xclip does for you.

On Thu, Dec 12, 2024 at 1:18 PM Filipp Gunbin <fgunbin@fastmail.fm> wrote:

> On 12/12/2024 13:08 -0500, Ship Mints wrote:
>
> > You need something like https://elpa.gnu.org/packages/xclip.html to
> assist
> > connecting macOS terminal Emacs to the system pasteboard/clipboard.
>
> Thanks, BTW paste with Command-V works, it's just copy that doesn't
> work.  Probably I'll disable xterm-mouse-mode anyway, but it would be
> nice to have this resolved in Emacs.
>

[-- Attachment #2: Type: text/html, Size: 1187 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled
  2024-12-12 17:54 bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled Filipp Gunbin
  2024-12-12 18:08 ` Ship Mints
@ 2024-12-12 19:15 ` Eli Zaretskii
  2024-12-12 19:18   ` Ship Mints
  2024-12-12 19:55   ` Gerd Möllmann
  1 sibling, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2024-12-12 19:15 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 74833

> From: Filipp Gunbin <fgunbin@fastmail.fm>
> Date: Thu, 12 Dec 2024 20:54:53 +0300
> 
> macOS, Terminal.app, xterm-mouse-mode enabled
> emacs -nw -Q
> Select something with mouse, press Command-c
> Try to paste into another program - text is not in the clipboard
> 
> Perhaps this is not new, I just tried xterm-mouse-mode for the first
> time, given that it's now the default in master.
> 
> Trying different combinations of select-enable-clipboard and
> select-enable-primary did not help (that variables are all I know in
> this area).

Does the macOS Terminal.app support the xterm mouse protocol?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled
  2024-12-12 19:15 ` Eli Zaretskii
@ 2024-12-12 19:18   ` Ship Mints
  2024-12-12 19:32     ` Eli Zaretskii
  2024-12-12 19:55   ` Gerd Möllmann
  1 sibling, 1 reply; 9+ messages in thread
From: Ship Mints @ 2024-12-12 19:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74833, Filipp Gunbin

[-- Attachment #1: Type: text/plain, Size: 892 bytes --]

It supports a subset of mouse behavior via this user setting:

https://support.apple.com/guide/terminal/turn-on-mouse-reporting-trmlc69728a5/2.12/mac/11.0

On Thu, Dec 12, 2024 at 2:16 PM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Filipp Gunbin <fgunbin@fastmail.fm>
> > Date: Thu, 12 Dec 2024 20:54:53 +0300
> >
> > macOS, Terminal.app, xterm-mouse-mode enabled
> > emacs -nw -Q
> > Select something with mouse, press Command-c
> > Try to paste into another program - text is not in the clipboard
> >
> > Perhaps this is not new, I just tried xterm-mouse-mode for the first
> > time, given that it's now the default in master.
> >
> > Trying different combinations of select-enable-clipboard and
> > select-enable-primary did not help (that variables are all I know in
> > this area).
>
> Does the macOS Terminal.app support the xterm mouse protocol?
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 1628 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled
  2024-12-12 19:18   ` Ship Mints
@ 2024-12-12 19:32     ` Eli Zaretskii
  2024-12-12 20:07       ` Gerd Möllmann
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2024-12-12 19:32 UTC (permalink / raw)
  To: Ship Mints; +Cc: 74833, fgunbin

> From: Ship Mints <shipmints@gmail.com>
> Date: Thu, 12 Dec 2024 14:18:47 -0500
> Cc: Filipp Gunbin <fgunbin@fastmail.fm>, 74833@debbugs.gnu.org
> 
> It supports a subset of mouse behavior via this user setting:
> 
> https://support.apple.com/guide/terminal/turn-on-mouse-reporting-trmlc69728a5/2.12/mac/11.0

That doesn't tell enough.  xterm.el and xterm-mouse assume full
support for the xterm protocols, so partial support could well explain
why things don't work.

In general, I don't recommend turn on xterm features on terminals
other than xterm, unless they are faithful emulations of xterm.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled
  2024-12-12 19:15 ` Eli Zaretskii
  2024-12-12 19:18   ` Ship Mints
@ 2024-12-12 19:55   ` Gerd Möllmann
  1 sibling, 0 replies; 9+ messages in thread
From: Gerd Möllmann @ 2024-12-12 19:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74833, Filipp Gunbin

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Filipp Gunbin <fgunbin@fastmail.fm>
>> Date: Thu, 12 Dec 2024 20:54:53 +0300
>> 
>> macOS, Terminal.app, xterm-mouse-mode enabled
>> emacs -nw -Q
>> Select something with mouse, press Command-c
>> Try to paste into another program - text is not in the clipboard
>> 
>> Perhaps this is not new, I just tried xterm-mouse-mode for the first
>> time, given that it's now the default in master.
>> 
>> Trying different combinations of select-enable-clipboard and
>> select-enable-primary did not help (that variables are all I know in
>> this area).
>
> Does the macOS Terminal.app support the xterm mouse protocol?

Yes it does.

The clipboard problem is something unrelated. Terminal applications can
access the macOS clipboard via command line utilities pbcopy and
pbpaste. I'm using the package xclip for that, which is very simple to
use

  ;; Clipboard support in terminal Emacs using pbcopy/pbpaste.
  (use-package xclip :straight t
    :if (not (display-graphic-p))
    :config (xclip-mode 1))

Command-C, Command-V in Terminal.app are used by Terminal.app itself and
not by applications running in the terminal emulator. For example, to
copy shell output or paste something as shell input.

I don't think Terminal.app allows altering Command-V etc. so that Emacs
could use them. Other terminal emulators like iTerm allow doing that.

In summary, this is not a bug.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled
  2024-12-12 19:32     ` Eli Zaretskii
@ 2024-12-12 20:07       ` Gerd Möllmann
  0 siblings, 0 replies; 9+ messages in thread
From: Gerd Möllmann @ 2024-12-12 20:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74833, fgunbin, Ship Mints

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Ship Mints <shipmints@gmail.com>
>> Date: Thu, 12 Dec 2024 14:18:47 -0500
>> Cc: Filipp Gunbin <fgunbin@fastmail.fm>, 74833@debbugs.gnu.org
>> 
>> It supports a subset of mouse behavior via this user setting:
>> 
>> https://support.apple.com/guide/terminal/turn-on-mouse-reporting-trmlc69728a5/2.12/mac/11.0
>
> That doesn't tell enough.  xterm.el and xterm-mouse assume full
> support for the xterm protocols, so partial support could well explain
> why things don't work.
>
> In general, I don't recommend turn on xterm features on terminals
> other than xterm, unless they are faithful emulations of xterm.

There is, for some reason, a checkbox in Terminal.app Settings dialog
with which one can make Terminal.app not send xterm mouse escape
sequences. If it's off when Emacs runs it doesn't get informed about
mouse clicks and so on. So nothing happens.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-12-12 20:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12 17:54 bug#74833: 31.0.50; Copy to OS clipboard doesn't work in macOS Terminal.app with xterm-mouse-mode enabled Filipp Gunbin
2024-12-12 18:08 ` Ship Mints
2024-12-12 18:18   ` Filipp Gunbin
2024-12-12 18:20     ` Ship Mints
2024-12-12 19:15 ` Eli Zaretskii
2024-12-12 19:18   ` Ship Mints
2024-12-12 19:32     ` Eli Zaretskii
2024-12-12 20:07       ` Gerd Möllmann
2024-12-12 19:55   ` Gerd Möllmann

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).