Skip to content

fix(tui): buffer terminal frame output - #361

Merged
Byron merged 1 commit into
Byron:mainfrom
larsch:fix/buffer-tui-output
Aug 4, 2026
Merged

fix(tui): buffer terminal frame output#361
Byron merged 1 commit into
Byron:mainfrom
larsch:fix/buffer-tui-output

Conversation

@larsch

@larsch larsch commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Interactive mode could render screen updates one character at a time when the system was under load, particularly on Windows.

The Ratatui Crossterm backend was writing directly to stderr, so its per-cell terminal commands were not buffered before being sent to the terminal. This made intermediate frame output visible during rendering.

This change wraps the TUI’s stderr writer in io::BufWriter. Ratatui still flushes the backend after each completed frame, preserving timely updates while ensuring frame output is written in larger batches.

Verification

  • cargo fmt --check
  • cargo check
  • cargo test --lib
  • Manually verified on Windows under load; significant improvement observed.
  • Manually verified on Linux under load; significant improvement observed.

@Byron Byron left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks so much!

I tried this on Windows and that fixes the sluggishness!
I always thought that's just how it is on Windows 😅.

@Byron
Byron merged commit c05f608 into Byron:main Aug 4, 2026
2 checks passed
@Byron

Byron commented Aug 4, 2026

Copy link
Copy Markdown
Owner

And it's released.

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