diff options
| author | Gregory Anders <greg@gpanders.com> | 2024-12-31 09:59:03 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-31 09:59:03 -0600 |
| commit | a389dc2f950ef89492dfc2d8334e421d2252cddf (patch) | |
| tree | 52173c06e3e4e95735e484ee3b554f12bd610ec3 /runtime/doc | |
| parent | 0bef3b911cc262a007fb4412d864c1832d1268ad (diff) | |
| download | rneovim-a389dc2f950ef89492dfc2d8334e421d2252cddf.tar.gz rneovim-a389dc2f950ef89492dfc2d8334e421d2252cddf.tar.bz2 rneovim-a389dc2f950ef89492dfc2d8334e421d2252cddf.zip | |
feat(clipboard)!: use OSC 52 as fallback clipboard provider (#31730)
We currently enable the OSC 52 clipboard provider by setting g:clipboard
when a list of conditions are met, one of which is that $SSH_TTY must be
set. We include this condition because often OSC 52 is not the best
clipboard provider, so if there are "local" providers available Nvim
should prefer those over OSC 52.
However, if no other providers are available, Nvim should use OSC 52
even when $SSH_TTY is not set. When a user is in an SSH session then the
checks for the other clipboard providers will still (typically) fail, so
OSC 52 continues to be enabled by default in SSH sessions.
This is marked as a breaking change because there are some cases where
OSC 52 wasn't enabled before and is now (or vice versa).
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/news.txt | 4 | ||||
| -rw-r--r-- | runtime/doc/provider.txt | 32 |
2 files changed, 18 insertions, 18 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 7ea65479f3..49d9bb5ce0 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -174,7 +174,9 @@ TREESITTER TUI -• TODO +• OSC 52 is used as a fallback clipboard provider when no other + |clipboard-tool| is found, even when not using SSH |clipboard-osc52|. To + disable OSC 52 queries, set the "osc52" key of |g:termfeatures| to false. VIMSCRIPT diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index c54a4df3d8..69ae0f20d1 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -259,23 +259,21 @@ For Windows WSL, try this g:clipboard definition: *clipboard-osc52* Nvim bundles a clipboard provider that allows copying to the system clipboard using OSC 52. OSC 52 is an Operating System Command control sequence that -writes the copied text to the terminal emulator. If the terminal emulator -supports OSC 52 then it will write the copied text into the system clipboard. - -Nvim will attempt to automatically determine if the host terminal emulator -supports the OSC 52 sequence and enable the OSC 52 clipboard provider if it -does as long as all of the following are true: - - • Nvim is running in the |TUI| - • |g:clipboard| is unset - • 'clipboard' is not set to "unnamed" or "unnamedplus" - • $SSH_TTY is set - -If any of the above conditions are not met then the OSC 52 clipboard provider -will not be used by default and Nvim will fall back to discovering a -|clipboard-tool| through the usual process. - -To force Nvim to use the OSC 52 provider you can use the following +causes the terminal emulator to write to or read from the system clipboard. + +When Nvim is running in the |TUI|, it will automatically attempt to determine if +the host terminal emulator supports OSC 52. If it does, then Nvim will use OSC +52 for copying and pasting if no other |clipboard-tool| is found and when +'clipboard' is unset. + + *g:termfeatures* +To disable the automatic detection, set the "osc52" key of |g:termfeatures| to +|v:false| in the |config| file. Example: >lua + local termfeatures = vim.g.termfeatures or {} + termfeatures.osc52 = false + vim.g.termfeatures = termfeatures +< +To force Nvim to always use the OSC 52 provider you can use the following |g:clipboard| definition: >lua vim.g.clipboard = { |