Guake / guake

Drop-down terminal for GNOME
https://guake.github.io
GNU General Public License v2.0
4.37k stars 577 forks source link

[Feature] Add support for OSC52 escape sequence #2222

Open kemelzaidan opened 5 months ago

kemelzaidan commented 5 months ago

From Reddit r/vim: https://www.reddit.com/r/vim/comments/k1ydpn/a_guide_on_how_to_copy_text_from_anywhere/

TL;DR: OSC52 is an ANSI escape sequence that allows you to copy text into your system clipboard from anywhere, including from remote SSH sessions. Check vim-oscyank, a plugin which integrates OSC52 into Vim.

What is OSC52?

OSC stands for Operating System Command, a category of ANSI escape sequences which instruct the terminal emulator to perform certain actions.

OSC52 is one of these sequence and tells the terminal that the string it carries must be copied to the system clipboard. Typically, an application encodes a string in base64, prefixes it with the OSC52 sequence and outputs it. The terminal parses the OSC sequence and updates the clipboard.

Why is it useful?

OSC52 is totally location-independent. The terminal does not care from where the sequence was emitted, even if it comes from a remote SSH session. It is especially useful in Vim since you are now able copy to your system clipboard from basically anywhere.

In my case, I found out I need that because I was using zellij terminal multiplexer over SSH and could not copy and paste. In the FAQs I found out that zellij uses OSC52 for it and that was the reason why: https://zellij.dev/documentation/faq#copy--paste-isnt-working-how-can-i-fix-this

I really like Guake, but that's a lacking feature I'm missing a lot since I use SSH a lot a I'm enjoying zellij so much and would not like to change to another terminal.


PS: Guake FeatHub link wasn't working... does this service still exist?