spudlyo / clipetty

Manipulate the system (clip)board with (e)macs from a (tty)
GNU General Public License v3.0
167 stars 13 forks source link

[Feature] Not able to use large clipboard over Alacritty #14

Closed ztlevi closed 4 years ago

ztlevi commented 4 years ago

Describe the feature It seems like copying fails if I try to copy over large number of lines, e.g. 100 lines. So I guess larger clipboard feature is not implemented for Alacritty.

According to the disscussion over here https://github.com/alacritty/alacritty/issues/600. Large clipboard is supported in Alacritty. Would you mind take a look at it and see if we are able to support it?

Thanks!

To Reproduce Basic copying steps.

Expected behavior A clear and concise description of what you expected to happen.

System Info (please complete the following information):

Additional context Add any other context about the problem here.

Shooooooooo commented 4 years ago

Just want to say thanks to bring this up as I am facing the same issue.

spudlyo commented 4 years ago

Hi there,

From reading the linked issue in alacritty/alacritty#600, it's not clear to me how they get around the OSC message length limitation to support large pastes. Alacritty doesn't seem like they use the same protocol extension that Kitty does. Can you try to paste something that is around 74,000 bytes and let me know if that works with Alacritty, because that should work.

ztlevi commented 4 years ago

Copying and pasting large bytes in pure terminal does work. I'm not 100 sure what you want me to test, in emacs or just terminal?

spudlyo commented 4 years ago

Sorry, I misspoke, I said 'paste' when I meant 'copy'. This gets to your bug, you wrote:

It seems like copying fails if I try to copy over large number of lines, e.g. 100 lines.

I was trying to figure out the maximum size of something you could copy with Clipetty using Alacritty -- and it looks like it's 765 bytes of text, which base64 encodes (how it is sent via OSC 52) to 1020 bytes. If you attempt to copy 766 bytes of text, that base64 encodes to 1024 bytes (a very suspicious number) which then fails. This leads me to believe that Alacritty will only accept base64 encoded OSC 52 payloads that are less than 1024 bytes in size.

spudlyo commented 4 years ago

By the way, this limitation is fixed in Alacritty version 0.4.2-dev and above. If you can upgrade, this should be fixed for you.

ztlevi commented 4 years ago

@spudlyo Yes, I can confirm alacritty 0.4.2 rc4 supports large clipboard. It just works out of box.

Thanks for the great help and amazing package!

It would be great to document in the README.

spudlyo commented 4 years ago

README updated, thanks for your report!