From a9df0c5ce6caa5e623c3140a80baf4b3c1ce07db Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Fri, 26 Jan 2024 20:06:13 +0200 Subject: [PATCH] fix(osc52): do not use 'vim.iter' (#27218) Problem: Using 'vim.iter' loads it during startup. Solution: Do not use 'vim.iter'. --- runtime/plugin/osc52.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/runtime/plugin/osc52.lua b/runtime/plugin/osc52.lua index 7a90518966..7ffd64342e 100644 --- a/runtime/plugin/osc52.lua +++ b/runtime/plugin/osc52.lua @@ -1,6 +1,10 @@ -local tty = vim.iter(vim.api.nvim_list_uis()):any(function(ui) - return ui.chan == 1 and ui.stdout_tty -end) +local tty = false +for _, ui in ipairs(vim.api.nvim_list_uis()) do + if ui.chan == 1 and ui.stdout_tty then + tty = true + break + end +end if not tty or vim.g.clipboard ~= nil or vim.o.clipboard ~= '' or not os.getenv('SSH_TTY') then return