[vim/vim] add OSC 52 clipboard support (Issue #14995)

14 views
Skip to first unread message

Peter Wu

unread,
Jun 13, 2024, 5:06:45 PM (5 days ago) Jun 13
to vim/vim, Subscribed

A recent PR feat(clipboard): add OSC 52 clipboard support #25872 allows Neovim v0.10 to support both copy and paste operations using OSC52.

It's trivial to implement the copy operation with Vimscript but it's quite difficult to implement the paste operation without some changes.

If I understand it correctly, Neovim basically repurposes the TermReponse event to capture the content sent from the terminal after the right paste escape chars are written to the terminal.

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
It's difficult to use the existing VIM features to support the OSC52 paste operation, esp. the part where the content from the terminal can't be easily captured and made available.

Describe the solution you'd like
Implement OSC52 copy and paste natively and provide g: options for configuration (e.g. on/off)

Describe alternatives you've considered
Use a 3rd party program, such as this one (https://github.com/theimpostor/osc) to help capture the pasted content via a call to system().


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14995@github.com>

zeertzjq

unread,
Jun 13, 2024, 5:11:13 PM (5 days ago) Jun 13
to vim/vim, Subscribed

Note: Nvim's TermResponse event is completely different from Vim's TermResponse and TermResponseAll.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14995/2166801511@github.com>

Peter Wu

unread,
Jun 13, 2024, 5:17:05 PM (5 days ago) Jun 13
to vim/vim, Subscribed

For completeness, this is the PR where Neovim repurposed TermReponse.

neovim/neovim#25868


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14995/2166809358@github.com>

Christian Brabandt

unread,
Jun 15, 2024, 9:03:06 AM (3 days ago) Jun 15
to vim/vim, Subscribed

This migh be a big complicated, because typically terminal escapes can occur later, even withing other events that need to be handled. I have no idea how complex setting this up.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14995/2169546945@github.com>

Peter Wu

unread,
Jun 15, 2024, 11:39:02 AM (3 days ago) Jun 15
to vim/vim, Subscribed

maybe add a new code to handle osc52 paste in TermResponseAll?

h: TermResponseAll already warns

	Note that this event may be triggered halfway
	executing another event, especially if file I/O,
	a shell command or anything else that takes time
	is involved.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14995/2169940098@github.com>

Reply all
Reply to author
Forward
0 new messages