martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.23k stars 256 forks source link

system clipboard not working on macOS #863

Closed erf closed 4 years ago

erf commented 4 years ago

yank "*y and paste "*p using system clipboard fails on macOS (10.15.6) with the following message:

Command failed System clipboard not supported

I'm on latest version of vis (6a569c8).

I found that before commit 9cb69f746312efa7c01c1dd4185bface3b30bb6d copy/pasting was working as expected.

Did that commit change how to use the clipboard or is this an error?

jeremybobbin commented 4 years ago

Oh, woops. Thanks for bringing this up.

Could you share the output of:

sh -x $(which vis-clipboard) --paste
erf commented 4 years ago

Here you go:

+ case "$1" in
+ vc_paste
++ vc_determine_command
+ PASTE_CMD=mac
+ '[' 0 -ne 0 ']'
+ '[' -z mac ']'
+ vc_mac_paste
+ pbpaste
sh -x $(which vis-clipboard) --paste+ exit 0
jeremybobbin commented 4 years ago

Ahh, ok.

+ is the register for the "clipboard" selection. * is the register for the "primary" selection.

"*y invokes vis-clipboard --selection primary --copy.

Since MacOS' desktop environment only offers one clipboard, "*y will err with "clipboard primary selection is not supported on your platform". Maybe Vis should display the error message that vis-clipboard produces.

The + register should work for you, though.

erf commented 4 years ago

Ah, great. I though i tried it before, but now i deleted the config.h and config.mk and it works on latest. Thank you!