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.
This commit is contained in:
Gregory Anders
2025-08-22 15:05:43 -05:00
committed by GitHub
parent 5d8e870c11
commit 586b1b2d9b
16 changed files with 161 additions and 13 deletions

View File

@@ -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