runtime(osc52): Omit paste from the osc52 provider when g:osc52_disable_paste is enabled
Commit: https://github.com/vim/vim/commit/5a4291d34e9855c7c85a7486b50f1ecbac130daa Author: mikoto2000 <[email protected]> Date: Sun Mar 1 19:23:34 2026 +0000 runtime(osc52): Omit paste from the osc52 provider when g:osc52_disable_paste is enabled Omit paste capability from the osc52 provider when g:osc52_disable_paste is enabled This avoids OSC 52 paste queries on unsupported terminals and prevents the +/* registers from being treated as empty. Documentation updated accordingly. related: #18983 closes: #19542 Signed-off-by: mikoto2000 <[email protected]> Signed-off-by: Christian Brabandt <[email protected]> diff --git a/runtime/pack/dist/opt/osc52/doc/osc52.txt b/runtime/pack/dist/opt/osc52/doc/osc52.txt index 97a63289c..7ac73c076 100644 --- a/runtime/pack/dist/opt/osc52/doc/osc52.txt +++ b/runtime/pack/dist/opt/osc52/doc/osc52.txt @@ -62,9 +62,10 @@ setting |g:osc52_force_avail| to true. *g:osc52_disable_paste* If your terminal does not support pasting via OSC 52, or has it disabled, then -it is a good idea to set g:osc52_disable_paste to TRUE. This will cause an -empty string to be returned when Vim attempts to query the osc52.vim provider, -instead of doing a blocking wait, as said in |osc52-support|. +it is a good idea to set g:osc52_disable_paste to TRUE. This will register +only the "copy" method for the osc52.vim clipboard provider, so Vim will not +attempt an OSC 52 paste query and avoids the blocking wait described in +|osc52-support|. ============================================================================== vim:tw=78:ts=8:fo=tcq2:ft=help: diff --git a/runtime/pack/dist/opt/osc52/plugin/osc52.vim b/runtime/pack/dist/opt/osc52/plugin/osc52.vim index 66b5752e5..0ae16376a 100644 --- a/runtime/pack/dist/opt/osc52/plugin/osc52.vim +++ b/runtime/pack/dist/opt/osc52/plugin/osc52.vim @@ -3,7 +3,7 @@ vim9script # Vim plugin for OSC52 clipboard support # # Maintainer: The Vim Project <https://github.com/vim/vim> -# Last Change: 2025 Dec 18 +# Last Change: 2026 Mar 01 if !has("timers") finish @@ -11,18 +11,25 @@ endif import autoload "../autoload/osc52.vim" as osc -v:clipproviders["osc52"] = { +var provider: dict<any> = { "available": osc.Available, - "paste": { - "*": osc.Paste, - "+": osc.Paste - }, "copy": { "*": osc.Copy, "+": osc.Copy }, } +if !get(g:, 'osc52_disable_paste', 0) + provider->extend({ + "paste": { + "*": osc.Paste, + "+": osc.Paste + } + }) +endif + +v:clipproviders["osc52"] = provider + def SendDA1(): void if !has("gui_running") && !get(g:, 'osc52_force_avail', 0) && !get(g:, 'osc52_no_da1', 0) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1vwmUN-001qip-L7%40256bit.org.
