Open dsoprea opened 3 years ago
On which system are you? On Linux with X11, selecting with the mouse should automatically copy to the primary selection (like most other programs). And on (all?) other systems, selecting with the mouse should copy by default to the system clipboard
Ah, sorry. Forgot to mention that I'm on Manjaro.
On Fri, Apr 23, 2021, 07:26 Benoit de Chezelles @.***> wrote:
On which system are you? On Linux with X11, selecting with the mouse should automatically copy to the primary selection (like most other programs). And on (all?) other systems, selecting with the mouse should copy by default to the system clipboard
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wez/wezterm/issues/722#issuecomment-825593015, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFOW2QCXYNWZPOHTN5A5ADTKFKOLANCNFSM43OJNQYA .
Mouse selection should "just work" by default as you say, on Manjaro I'm guessing you're on X11 not Wayland, try to select some text in wezterm and paste it in another program (or in wezterm) with Shift-Insert or a middle click (this is usually how to paste the primary selection). It should also work from another program to wezterm.
If you want to instead copy to the system clipboard (so you can paste with Ctrl-v or similar), you need to press a short cut (Ctrl-Shift-c) after you selected something in wezterm (and other programs on linux). This can be changed in wezterm, by setting a mouse binding like:
return {
mouse_bindings = {
-- Change the default click behavior so that it only selects/copy
-- text and doesn't open hyperlinks.
{
event={Up={streak=1, button="Left"}},
mods="NONE",
-- complete the selection and copy it to the system clipboard
action=wezterm.action{CompleteSelection="Clipboard"},
-- for reference, the default action is:
--action=wezterm.action{CompleteSelectionOrOpenLinkAtMouseCursor="PrimarySelection"},
},
},
}
This is derived from an example in https://wezfurlong.org/wezterm/config/mouse.html
If that doesn't work, can you please describe precisely what you're trying (key presses, mouse clicks) and what doesn't work?
@wez maybe we can have a standalone page about the clipboard in the docs, to explain the select-to-copy behavior of the mouse, and give some intel about how clipboard/primary-selection works on Linux by default (for unsuspecting people 👀), and give links to mouse/key binding pages & the various KeyAssignement that can be used around copying things
I'd like just to be able to select something and have it copy. It seems like this might be supported, though searching for "copy" in the config index results in four hits, all of which are keyboard oriented. However, under the entry for "Copy Mode" (https://wezfurlong.org/wezterm/copymode.html), it implies that the mouse support is there, or maybe should even "just work" by default:
But, there's seemingly no documentation for it. So, the alternative is that I have to use a three-button shortcut, which is too heavy to be done as frequently as I need it.