Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions e2e/cli/test_upgrade_progress_summary
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

echo 'dummy 1' >.tool-versions
mise install dummy@1.0.0 >/dev/null 2>&1 || fail "pre-install of dummy@1.0.0 failed"

output="$(MISE_FORCE_PROGRESS=1 mise up dummy 2>&1)"
summary_line=" dummy 1.0.0 → 1.1.0"

if [[ $output != *"$summary_line"* ]]; then
fail "upgrade summary did not include '$summary_line': $output"
fi

after_summary="${output#*"$summary_line"}"
if grep -q $'\033\\[[0-9;]*J' <<<"$after_summary"; then
fail "upgrade summary was followed by a terminal clear sequence"
fi
2 changes: 2 additions & 0 deletions src/cli/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ impl Upgrade {
}
}

mpr.finish_progress();
let ts = config.get_toolset().await?;

// Fix up sources and requests for lockfile update - CLI args produce
Expand Down Expand Up @@ -411,6 +412,7 @@ impl Upgrade {
});
}

mpr.finish_progress();
Comment thread
risu729 marked this conversation as resolved.
Self::print_summary(&outdated, &successful_versions)?;

install_error
Expand Down
8 changes: 6 additions & 2 deletions src/ui/multi_progress_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,13 @@ impl MultiProgressReport {

progress_trace!("footer_finish: completed={}, total={}", completed, total);

// Stop clx progress
progress::stop();
self.finish_progress();
}

/// Render the final progress state, then clear clx's registered jobs so
/// later regular terminal output cannot be erased by process shutdown.
pub fn finish_progress(&self) {
progress::stop();
self.reset_jobs();
}

Expand Down
Loading