From 586b1b2d9bcfdbc2a58a7a9c90e8f90e638173e7 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Fri, 22 Aug 2025 15:05:43 -0500 Subject: feat(tui): add nvim_ui_send (#35406) This function allows the Nvim core to write arbitrary data to a TTY connected to a UI's stdout. --- runtime/lua/vim/_defaults.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim/_defaults.lua') diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua index df4695af50..d240bb47e9 100644 --- a/runtime/lua/vim/_defaults.lua +++ b/runtime/lua/vim/_defaults.lua @@ -839,7 +839,7 @@ do end, }) - io.stdout:write('\027]11;?\007') + vim.api.nvim_ui_send('\027]11;?\007') end --- If the TUI (term_has_truecolor) was able to determine that the host @@ -927,7 +927,7 @@ do local decrqss = '\027P$qm\027\\' -- Reset attributes first, as other code may have set attributes. - io.stdout:write(string.format('\027[0m\027[48;2;%d;%d;%dm%s', r, g, b, decrqss)) + vim.api.nvim_ui_send(string.format('\027[0m\027[48;2;%d;%d;%dm%s', r, g, b, decrqss)) timer:start(1000, 0, function() -- Delete the autocommand if no response was received -- cgit