commit 5468e6a452721f9d09ee459fedd200fef05a5eaa
parent 6b4ec2264e1d8ba027b85f3883d532c5068be92a
Author: Andrew Braxton <andrewcbraxton@gmail.com>
Date: Thu, 12 Feb 2026 04:15:53 -0500
fix(pack): skip :redraw! if headless #37782
Otherwise, output will be concatenated without newlines.
TODO: the ":redraw!" call can be dropped entirely after ui2 becomes the default.
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/runtime/lua/vim/pack.lua b/runtime/lua/vim/pack.lua
@@ -484,6 +484,7 @@ end
--- @return fun(kind: 'begin'|'report'|'end', percent: integer, fmt: string, ...:any): nil
local function new_progress_report(action)
local progress = { kind = 'progress', title = 'vim.pack' }
+ local headless = #api.nvim_list_uis() == 0
return vim.schedule_wrap(function(kind, percent, fmt, ...)
progress.status = kind == 'end' and 'success' or 'running'
@@ -491,7 +492,10 @@ local function new_progress_report(action)
local msg = ('%s %s'):format(action, fmt:format(...))
progress.id = api.nvim_echo({ { msg } }, kind ~= 'report', progress)
-- Force redraw to show installation progress during startup
- vim.cmd.redraw({ bang = true })
+ -- TODO: redraw! not needed with ui2.
+ if not headless then
+ vim.cmd.redraw({ bang = true })
+ end
end)
end