zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
21.19k stars 643 forks source link

Cannot copy&paste text #2400

Closed fgadaleta closed 1 year ago

raphCode commented 1 year ago

Can you please provide more information? What did you try? What setup: terminal emulator? ssh?

zellij has some options regarding clipboard copy/paste, did you try them?

fgadaleta commented 1 year ago

CTRL + SHIFT + x to copy and CTRL + SHIFT + v to paste to console, is not working

On Tue, Apr 25, 2023, at 5:27 PM, raphCode wrote:

Can you please provide more information? What did you try? What setup: terminal emulator? ssh?

zellij has some options regarding clipboard copy/paste, did you try them?

— Reply to this email directly, view it on GitHub https://github.com/zellij-org/zellij/issues/2400#issuecomment-1521999755, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYTR34WJU6LPUTTQ4QTCMTXC7UO7ANCNFSM6AAAAAAXJMHESU. You are receiving this because you authored the thread.Message ID: @.***>

raphCode commented 1 year ago

Marking text with the mouse while holding shift should produce a selection from the terminal emulator. You should be able to copy that and paste it as well with the shortcuts you mentioned. For me, this works using alacritty.

If you want, I am happy to help you get this to work. Please provide more information / answer my questions. Your terse writing makes it hard to understand what is going on and comes across rude.

fgadaleta commented 1 year ago

yes indeed it works. Only issue is that if i have multiple panels and select a row in one panel, it selects the entire row of the screen (expected, but nice to have)

raphCode commented 1 year ago

clicking + dragging without any keys should activate zellij's internal selection that only spans the active pane. On mouse release zellij copies the selection to the clipboard. You can configure in the options whether to use the primary selection or normal system clipboard. However, this relies on clipboard support of the terminal emulator and anything between it and zellij. E.g. if you are using ssh, it must support that too.

Workaround if you don't get it to work: maximize the current pane (Ctrl-P F) and disable pane frames (Ctrl-P Z), then use shift + mouse select.

fgadaleta commented 1 year ago

ah this is great! thank you ;)

raphCode commented 1 year ago

it works now? :)

fgadaleta commented 1 year ago

Dragging and clicking indeed selects and copies from the same panel. But when I paste, it finds something that is in the Linux clipboard (I find something i copied from e.g. firefox)

fgadaleta commented 1 year ago

maximizing the panel and holding shift, it works.

(though a bit annoying to maximize/minimize the panel all the time :P )

raphCode commented 1 year ago

Dragging and clicking indeed selects and copies from the same panel. But when I paste, it finds something that is in the Linux clipboard (I find something i copied from e.g. firefox)

Let's find out where it goes wrong... What does it say on the bottom when you release the mouse?

For me, it's this: image Afterwards I can paste the text with Ctrl-V anywhere.

fgadaleta commented 1 year ago

Yes, it says "Text copied to system clipboard" but when i SHIFT+CTRL+V (to console) it pastes what i copied with a regular CTR + V from somewhere else.

In console CTRL + V does not work. When i copy from zellij via selection and CTR + V anywhere else I find the same thing I copied out of zellij

raphCode commented 1 year ago

When i copy from zellij via selection and CTR + V anywhere else I find the same thing I copied out of zellij

Very good, that means zellij and your terminal emulator are working correctly for copying!

Yes, it says "Text copied to system clipboard" but when i SHIFT+CTRL+V (to console) it pastes what i copied with a regular CTR + C from somewhere else.

This, however, is very weird. Since SHIFT+CTRL+V is handled by the terminal emulator, zellij is likely not at fault here. What terminal are you using?

Can you try:

My reasoning is that somehow the terminal seems not to update its/the system clipboard

fgadaleta commented 1 year ago

exactly it seems it's not updating the system clipboard (no clue why). when i paste here (after copying from zellij), it doesn't paste the right thing. Same when i do shift+ctrl+v

I am using Mate Terminal Same issue in Konsole

raphCode commented 1 year ago

when i paste here (after copying from zellij), it doesn't paste the right thing.

Oh, so the previous message read like it does? For clarification:

I am using Mate Terminal Same issue in Konsole

They have to support the OSC52 escape sequence. I could not find if Mate supports it, but there is an open bug against Konsole that indicates that it does not support that: https://bugs.kde.org/show_bug.cgi?id=372116

You can test if your terminal emulator supports copy to system clipboard by executing: printf "\033]52;c;Y29weXBhc3RhIQ==\a\n" After that, the clipboard should contain copypasta!

The solution is to use a different terminal. There is nothing zellij can do about it.

fgadaleta commented 1 year ago

image

but good news, with alacritty it works like charm. So that's definitely a terminal issue

raphCode commented 1 year ago

image

It it not supposed to print anything, but place the text in the system clipboard.

Great to hear that a different terminal works for you!

grm34 commented 1 year ago

I use this workaround to get paste working on CTRL+SHIFT+V

copy_command "wl-copy -p"
tonjo commented 1 year ago

Hi, this issue is closed, so I'd expect copy and paste will work, but it won't, neither with middle click nor shift-ctrl-v.

The only workaround is options --disable-mouse-mode but I prefer not. Will it never be fixed?