prune,ui: show the removal pass, prefix the sizing spinner
Confirming a 500 GiB prune went silent under "Removing:" for minutes: drive an indicatif bar from the plan's sizes through a new apply_with_progress observer, in the deb live view's layout — the running count behind the spinner on the first line, the byte bar with its counters on the second. The removed path is not rendered: it fights the bar on a narrow terminal, and the failed-removal errors name the paths that matter. --force plans no sizes and gets the count line only. The dry-run size spinner lacked the "> " prompt prefix the other one-line waits carry; wait_spinner renders it too now.
This commit is contained in:
+1
-8
@@ -488,7 +488,7 @@ fn drop_pane(shared: &Shared) {
|
||||
/// Render the pane content with per-kind colors, ellipsizing lines that are
|
||||
/// wider than the terminal so they do not overflow onto a wrapped line
|
||||
fn render_pane(lines: &VecDeque<(Kind, String)>) -> String {
|
||||
let max_width = terminal_width().map(|w| w.saturating_sub(PANE_PREFIX_WIDTH));
|
||||
let max_width = crate::ui::terminal_width().map(|w| w.saturating_sub(PANE_PREFIX_WIDTH));
|
||||
render_pane_with_width(lines, max_width)
|
||||
}
|
||||
|
||||
@@ -515,13 +515,6 @@ fn render_pane_with_width(lines: &VecDeque<(Kind, String)>, max_width: Option<us
|
||||
/// Display width of the ` │ ` prefix rendered before each pane line
|
||||
const PANE_PREFIX_WIDTH: usize = 4;
|
||||
|
||||
/// Width of the terminal in columns, or `None` when it cannot be determined
|
||||
fn terminal_width() -> Option<usize> {
|
||||
crossterm::terminal::size()
|
||||
.ok()
|
||||
.map(|(cols, _)| cols as usize)
|
||||
}
|
||||
|
||||
/// Ellipsize `text` to at most `max_width` display columns, keeping its head
|
||||
/// and appending `…` when it does not fit
|
||||
fn ellipsize(text: &str, max_width: usize) -> String {
|
||||
|
||||
Reference in New Issue
Block a user