Skip to content

fix: do not write console logs over the interactive TUI - #1909

Open
BradKollmyer wants to merge 2 commits into
rustic-rs:mainfrom
BradKollmyer:fix/tui-console-log-overlap
Open

fix: do not write console logs over the interactive TUI#1909
BradKollmyer wants to merge 2 commits into
rustic-rs:mainfrom
BradKollmyer:fix/tui-console-log-overlap

Conversation

@BradKollmyer

Copy link
Copy Markdown

Summary

  • capture console logs while the interactive TUI owns the terminal (raw mode / alternate screen)
  • print captured messages to stderr after the terminal is restored
  • leave file logging unchanged
  • print TUI errors after leaving the alternate screen instead of over the TUI

Why

Backend retry warnings were written to stderr while snapshots --interactive was drawing the progress popup. In raw mode those writes overwrite the gauge, so a temporary B2 retry looks like a garbled crash.

CLI progress already suspends indicatif via PbPauseAppender. The TUI never did.

Validation

  • cargo test --lib for TuiLogCapture (inactive pass-through, capture until drop, nested guards, overflow, replay)
  • cargo clippy --lib --tests -- -D warnings

Complements rustic-rs/rustic_core#562, which stops OpenDAL retries from dumping a multi-line Debug error tree. This PR is independent of that change.

Capture stderr logs while the TUI owns the terminal and print them
after restoring cooked mode, so backend retry warnings cannot overwrite
the progress popup.
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.

1 participant