Skip to content

fix(cli): redraw progress bars in place so a bundle get does not flicker - #2480

Merged
alpergundogdu merged 1 commit into
mainfrom
fix/progress-move-cursor
Oct 16, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
fix/progress-move-cursor

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

  • indicatif::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 (the launch race GIF) catch the erased frames and the stack flashes.
  • Both containers in crates/cli/src/logging.rs (the global one and the standalone fallback) now come from new_container(), which calls set_move_cursor(true) so redraws overwrite the lines in place.

Test plan

  • cargo clippy -p decdn-cli --all-targets -- -D warnings
  • cargo test -p decdn-cli pull_progress
  • Visual check: a bundle decdn get in a tmux pane no longer flashes

🤖 Generated with Claude Code

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]>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 a MultiProgress and calls set_move_cursor(true) so redraws overwrite lines in place instead of erase-then-write.
  • Route both container creation sites (the global one in init and the standalone fallback in progress_container) through new_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.

@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main 0695b2b fix/progress-move-cu... 3294c5a +/-
75% 75% 0%
View coverage of the 2 most impacted files.
File main 0695b2b fix/progress-move-cu... 3294c5a +/-
crates/cli/src/logging.rs 41% 38% -3%
crates/node/src...s/client/mod.rs 90% 89% -1%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

@alpergundogdu
alpergundogdu merged commit b63a283 into main Oct 16, 2026
32 checks passed
@alpergundogdu
alpergundogdu deleted the fix/progress-move-cursor branch October 16, 2026 13:04
alpergundogdu added a commit that referenced this pull request Oct 16, 2026
#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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants