From ee7380f57299930824c8b8f006825901cddc4fb3 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Mon, 5 Oct 2026 09:50:34 +0200 Subject: [PATCH] deb: shorten the staged-tree copy progress label The live view's bar template renders the byte counters after the bar, so baking them into the message too duplicated them and pushed the line past the terminal width. Announce the copy as "Restoring " and leave the counters to the view. --- src/deb/mod.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/deb/mod.rs b/src/deb/mod.rs index 14540bf..21fcb80 100644 --- a/src/deb/mod.rs +++ b/src/deb/mod.rs @@ -821,16 +821,12 @@ fn copy_report<'a>( base_id: &str, ) -> Option> { view.map(|view| { - let label = format!("Copying the staged tree of record {base_id}"); + // The views render the byte counters after the bar: the label + // must stay short or the bar line overflows a narrow terminal. + let label = format!("Restoring {base_id}"); view.message(&label); - Box::new(move |pos: u64, total: u64| { - let size = crate::utils::size::format_bytes; - view.byte_progress( - &format!("{label} ({}/{})", size(pos), size(total)), - pos, - total, - ) - }) as Box + Box::new(move |pos: u64, total: u64| view.byte_progress(&label, pos, total)) + as Box }) }