zellij-org / zellij

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

Linux can not copy text #1673

Closed lucasjinreal closed 2 years ago

lucasjinreal commented 2 years ago

Please add some notice on readme or doc, I tried both macos and linux (buntu)

all can not copy text out-of-box, this is realy annoying and effect the experience for using this useful tool!

It would be much more better if copy text can use out-of-box at least on:

odrevet commented 2 years ago

I had this problem too, copy works with alacritty

imsnif commented 2 years ago

This happens because iTerm2 and terminator do not support the OSC52 signal, which is what we use to copy text to the clipboard. The workaround we have for this, as I guess you know, is to allow the user to define a custom copy command that we can use instead.

There are two issues with making this the default:

  1. It would not work over SSH or in any remote environment
  2. We can't install this external command for the user

While I agree with you that it would have been much better for this to "just work", I think we don't really have a very good option here. Maybe you can suggest a way to make this clearer to the user?

lucasjinreal commented 2 years ago

@imsnif Since this related about zellij deep machenism, I suggest we take those iterm use into accurtoun, make a special install instructions for them so that they follow it and can use copy right out-of-box, wihtout any further interruptions when using.

Any config file is OK, but just better need a speciial install tips of iterm2 && terminator users.

Of course, if zellij can suggest a more wideused terminal APP is also OK. But from I can see, these two are mostly used as thirdy party terminal APP.

imsnif commented 2 years ago

@jinfagang - how about if we add a special copy/paste section here? https://zellij.dev/documentation/faq

lucasjinreal commented 2 years ago

@imsnif Sure. If there is a example config file could be better, I think these APPs should only need a unified configuration.

As well as prerequested command it need.

tlinford commented 2 years ago

It should work on iterm2, if configured.

When first selecting text I got this warning:

Screenshot 2022-08-18 at 13 15 07

The option Applications in terminal may access clipboard option needs to be enabled:

Screenshot 2022-08-18 at 13 16 22
lucasjinreal commented 2 years ago

this works on paste, not copy.

tlinford commented 2 years ago

this works on paste, not copy.

hmm i'm a bit confused here then - as far as I can tell it works fine, after setting the option, with zellij on default config i can select text with mouse and it goes to the system clipboard.

This osc52 mechanism could also in theory also be used to read from the system clipboard (basically do a paste), but we don't use that in zellij, and it is not widely supported by terminal emulators.

lucasjinreal commented 2 years ago

that's weird, my iterm2 not work, zellij promote copied, but my clipboard actually has nothing. I believe if you don't config anything it shouldn't work as @imsnif says.

imsnif commented 2 years ago

@jinfagang - do you mean that you checked the checkbox like @tlinford showed in the screenshot and it's still not in the clipboard?

lucasjinreal commented 2 years ago

oh shit. shit shit shit, It works on my home Mac, but my company Mac.... so weird.

imsnif commented 2 years ago

No problem @jinfagang ! Would you like help troubleshooting this?

lucasjinreal commented 2 years ago

Let me check again when get to work

imsnif commented 2 years ago

@jinfagang - any news? If all is working for you, can we close this issue?

lucasjinreal commented 2 years ago

Yes for sure, now I can using zellij in my daily work without pain!

lucasjinreal commented 2 years ago

I am using system ternimal now, it still can not copy text, why life so hard?

imsnif commented 2 years ago

Hey @jinfagang - as explained in https://github.com/zellij-org/zellij/issues/1699#issuecomment-1231311251 (and after we added this to the FAQ section here: https://zellij.dev/documentation/faq.html#copy--paste-isnt-working-how-can-i-fix-this) I'm closing this issue.