Repository navigation
fix(cli): redraw progress bars in place so a bundle get does not flicker - #2480
Conversation
indicatif's MultiProgress erases every bar line before rewriting it by default. A bundle decdn get stacks ~jobs+1 bars and redraws them several times a second, so tmux panes and terminal recordings catch the erased frames as flashing. set_move_cursor(true) overwrites the lines in place. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The change is a small, self-contained CLI cosmetic fix that correctly centralizes MultiProgress creation through one helper using a valid indicatif API, with an accurate present-tense doc comment and no remaining direct construction sites.
0 open findings
What changed in this PR
This PR fixes a cosmetic terminal issue in the decdn CLI: a bundle decdn get stacks multiple progress bars (--jobs+1) and redraws them several times a second. By default indicatif::MultiProgress erases each line before rewriting it, so tmux panes and screen recordings capture the erased frames and the bar stack flickers. The fix centralizes MultiProgress construction in a new helper that enables in-place redraws.
Changes:
- Add a private
new_container()helper that constructs aMultiProgressand callsset_move_cursor(true)so redraws overwrite lines in place instead of erase-then-write. - Route both container creation sites (the global one in
initand the standalone fallback inprogress_container) throughnew_container().
| File | Description |
|---|---|
| crates/cli/src/logging.rs | Introduces new_container() with set_move_cursor(true) and uses it for both the global and fallback progress containers to stop progress-bar flicker. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 2 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
#2481) The in-place redraw from #2480 has two gaps in indicatif 0.18: - When the stack shrinks (a finished file's bar clears), the rows it no longer covers are never erased, so old total lines pile up under it. The container is now bottom-aligned, so a shrunk stack pads its top with blank lines, and its draw target erases each padding row as it writes it. - The run header, printed with println before any bar exists, is overwritten by the first bar. It now goes out through suspend with its own newline. Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
indicatif::MultiProgresserases every bar line before rewriting it by default. A bundledecdn getstacks--jobs+1 bars and redraws them several times a second, so tmux panes and terminal recordings (the launch race GIF) catch the erased frames and the stack flashes.crates/cli/src/logging.rs(the global one and the standalone fallback) now come fromnew_container(), which callsset_move_cursor(true)so redraws overwrite the lines in place.Test plan
cargo clippy -p decdn-cli --all-targets -- -D warningscargo test -p decdn-cli pull_progressdecdn getin a tmux pane no longer flashes🤖 Generated with Claude Code