Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add support for OSC52 escape sequence #2222

Open
kemelzaidan opened this issue Jan 5, 2024 · 0 comments
Open

[Feature] Add support for OSC52 escape sequence #2222

kemelzaidan opened this issue Jan 5, 2024 · 0 comments

Comments

@kemelzaidan
Copy link

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?

@kemelzaidan kemelzaidan changed the title Add support for OSC52 escape sequence [Feature] Add support for OSC52 escape sequence Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant