Skip to content

How do I enable OSC52 on Mosh and SSH? #1948

Answered by iflowerml
iflowerml asked this question in Q&A
Discussion options

You must be logged in to vote

CLI applications, specially editors, regularly use their clipboard to perform copy or yank operations. OSC52 is an ANSI control sequence used to instruct the terminal to copy the string it carries to the system clipboard, even through remote connections over SSH and Mosh.

Mosh supports the OSC52 sequence out of the box since version 1.4.0, so make sure your mosh-server is up to date.

Then, you just need to instruct the specific CLI application to make use of the OSC52 sequence. Here is how to do so, and please chime in on this thread to add others!

Vim:
To enable copy/paste you’ll need to install ojroques/vim-oscyank and add the following line to .vimrc:

autocmd TextYankPost * if v:event.…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@carloscabanero
Comment options

Answer selected by carloscabanero
Comment options

You must be logged in to vote
1 reply
@carloscabanero
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants