From a389dc2f950ef89492dfc2d8334e421d2252cddf Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Tue, 31 Dec 2024 09:59:03 -0600 Subject: 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). --- test/functional/terminal/tui_spec.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'test') diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index de92aefd5b..f9145f9b63 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -3184,7 +3184,6 @@ describe('TUI', function() local req = args.data local payload = req:match('^\027P%+q([%x;]+)$') if payload and vim.text.hexdecode(payload) == 'Ms' then - vim.g.xtgettcap = 'Ms' local resp = string.format('\027P1+r%s=%s\027\\', payload, vim.text.hexencode('\027]52;;\027\\')) vim.api.nvim_chan_send(vim.bo[args.buf].channel, resp) return true @@ -3202,9 +3201,6 @@ describe('TUI', function() }, { env = { VIMRUNTIME = os.getenv('VIMRUNTIME'), - - -- Only queries when SSH_TTY is set - SSH_TTY = '/dev/pts/1', }, }) @@ -3212,8 +3208,7 @@ describe('TUI', function() local child_session = n.connect(child_server) retry(nil, 1000, function() - eq('Ms', eval("get(g:, 'xtgettcap', '')")) - eq({ true, 'OSC 52' }, { child_session:request('nvim_eval', 'g:clipboard.name') }) + eq({ true, { osc52 = true } }, { child_session:request('nvim_eval', 'g:termfeatures') }) end) end) end) -- cgit