From e23894bf0cd55d0f8b1bd6c9e507c60aa6182507 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 20 Nov 2025 22:22:58 +0800 Subject: fix refresh progress --- xmake/modules/utils/progress.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'xmake/modules/utils/progress.lua') diff --git a/xmake/modules/utils/progress.lua b/xmake/modules/utils/progress.lua index d531bee90..39b49841c 100644 --- a/xmake/modules/utils/progress.lua +++ b/xmake/modules/utils/progress.lua @@ -221,12 +221,6 @@ function _redraw_multirow_progress(maxwidth) return end - -- move cursor back to the top of progress area to avoid scrolling - local linecount = _g.linecount or 0 - if linecount > 0 then - tty.cursor_move_up(linecount + 1) - end - -- redraw the total progress line tty.erase_line().cr() cprint(last_total_progress) @@ -407,6 +401,14 @@ end function refresh() local refresh_mode = _g.refresh_mode if refresh_mode == "multirow" then + + -- move cursor back to the top of progress area to avoid scrolling + local linecount = _g.linecount or 0 + if linecount > 0 and not ss then + tty.cursor_move_up(linecount + 1) + end + + -- redraw the progress area immediately local maxwidth = os.getwinsize().width _redraw_multirow_progress(maxwidth) end -- cgit v1.3.1