fix(progress): one draw per file — drop set_message in TTY AssetStarted

set_draw_target switching broke cursor positioning: each hidden→stderr
restore caused indicatif to draw a fresh line instead of overwriting.
Root fix: call only set_position() in TTY AssetStarted (one draw per
file). Filename visible in non-TTY plain-line output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
th-kim0823
2026-05-07 22:28:37 +09:00
parent f25e16f80c
commit 3328760dca

View File

@@ -144,19 +144,10 @@ impl ProgressDisplay {
media,
} => {
if let Some(bar) = self.bar.as_ref() {
// Suppress draws during the two updates so only one frame
// lands in the TTY scrollback per file. set_position() and
// set_message() each call update_and_draw() independently —
// hiding the draw target collapses them into a single tick().
bar.set_draw_target(ProgressDrawTarget::hidden());
bar.set_message(format!("{media} {path}"));
// One draw per file: position only. set_message() would
// trigger a second independent draw and pollute TTY scrollback.
// Filename is visible in the non-TTY plain-line path below.
bar.set_position(u64::from(idx.saturating_sub(1)));
bar.set_draw_target(if tty && !quiet {
ProgressDrawTarget::stderr()
} else {
ProgressDrawTarget::hidden()
});
bar.tick();
}
if !tty && !quiet {
let mut err = std::io::stderr().lock();