ojroques / vim-oscyank

A Vim plugin to copy text through SSH with OSC52
BSD 2-Clause "Simplified" License
615 stars 38 forks source link

add support for zellij #30

Closed hbiel closed 1 year ago

hbiel commented 2 years ago

Hey @ojroques!

First of all thank you for creating this plugin. I would love to make use of it in my configuration.

I'm using Zellij as my terminal multiplexer though and it seems to need a different sequence than e.g. tmux. Would you be able to look into this and add support for it?

Here is a sequence I found in their repository: https://github.com/zellij-org/zellij/blob/67d2673cae60954e8287c2a1f58a21a56e066afb/zellij-server/src/tab/clipboard.rs#L34 Unfortunately I don't know how to read and implement this sequence exactly myself.

Best Regards!

ojroques commented 2 years ago

Hello!

I read that in the config of Zelliji:

# Provide a command to execute when copying text. The text will be piped to
# the stdin of the program to perform the copy. This can be used with
# terminal emulators which do not support the OSC 52 ANSI control sequence
# that will be used by default if this option is not set.

(source)

So first does OSC52 work outside of Vim when you copy text in Zelliji? And what terminal emulator do you use?

hbiel commented 2 years ago

Thank you for your quick response!

I'm on Windows and use Windows Terminal, mainly using a wsl distribution. This is how I'm copying text from Zellij so far:

  1. Select text via mouse
  2. On release of the button the message "Text copied to clipboard" gets printed
  3. I can paste the copied text in Windows

I didn't set any copy command in the configuration so I think OSC52 is used and working.

ojroques commented 2 years ago

So I've tried using the sequence from your link but it does not work. I suspect that Zelliji does not forward escape sequence from applications yet. There is a related issue already https://github.com/zellij-org/zellij/issues/1199.

hbiel commented 2 years ago

Ah, I see. I didn't know about this. Thanks for pointing it out. Should this issue stay open then? Are there possible changes you need to make once Zellij supports forwarding?

ojroques commented 2 years ago

Yes it can stay open. I don't think any change will be necessary but we'll see.

Winson-Huang commented 1 year ago

After https://github.com/zellij-org/zellij/pull/1644 this have been solved, I think this issue can be closed and shouldn't be opened in the first place :-(

ojroques commented 1 year ago

Great!