feat(🎄🎁): support reading the OSC52 clipboard contents in tests#862
Merged
mikavilpas merged 1 commit intomainfrom Dec 24, 2025
Merged
feat(🎄🎁): support reading the OSC52 clipboard contents in tests#862mikavilpas merged 1 commit intomainfrom
mikavilpas merged 1 commit intomainfrom
Conversation
**Issue:**
An important part of terminal applications is the ability to set and
read the system clipboard. This is not possible to test.
**Solution:**
Support an in-memory OSC52 clipboard in the terminal testing session
that can be tested. OSC52 is a terminal escape sequence that allows
terminal applications to set the clipboard contents of the host
terminal. It works locally and even over ssh connections.
Features:
- store the latest clipboard contents in memory, and allow **read-only**
access in tests.
- tests can only read the clipboard contents, not set them.
- the test application (e.g. neovim) can read + write the clipboard
contents normally using OSC52 requests.
- Does not affect the system clipboard of the host system (your
computer), which could disturb other tasks while the tests are
running. Now they are completely separate.
- support both "system" and "primary" clipboards. This is what xtermjs
exposes, and we now support both. The "system" clipboard seems to be
the default on macOS, while "primary" is probably used on Linux X11.
References:
- xtermjs 6.0 added support for OSC52 clipboard requests via
xtermjs/xterm.js#4220
- https://neovim.io/doc/user/provider.html#clipboard-osc52
Closes #857
mikavilpas
added a commit
to mikavilpas/yazi.nvim
that referenced
this pull request
Dec 24, 2025
mikavilpas
added a commit
to mikavilpas/yazi.nvim
that referenced
this pull request
Dec 24, 2025
mikavilpas
added a commit
to mikavilpas/tsugit.nvim
that referenced
this pull request
Dec 24, 2025
mikavilpas
added a commit
to mikavilpas/tsugit.nvim
that referenced
this pull request
Dec 24, 2025
mikavilpas
added a commit
to mikavilpas/blink-ripgrep.nvim
that referenced
this pull request
Dec 24, 2025
mikavilpas
added a commit
to mikavilpas/incr.nvim
that referenced
this pull request
Dec 24, 2025
mikavilpas
added a commit
to mikavilpas/blink-ripgrep.nvim
that referenced
this pull request
Dec 24, 2025
mikavilpas
added a commit
to mikavilpas/my-nvim-micro-plugins.nvim
that referenced
this pull request
Dec 24, 2025
mikavilpas
added a commit
to mikavilpas/my-nvim-micro-plugins.nvim
that referenced
this pull request
Dec 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue:
An important part of terminal applications is the ability to set and read the system clipboard. This is not possible to test.
Solution:
Support an in-memory OSC52 clipboard in the terminal testing session that can be tested. OSC52 is a terminal escape sequence that allows terminal applications to set the clipboard contents of the host terminal. It works locally and even over ssh connections.
Features:
References:
Closes #857