fix(tui/render): clear after WouldBlock redraw

This commit is contained in:
James Peter
2026-01-09 18:06:47 +10:00
parent 62c1cef13d
commit a354fdf80a
+5
View File
@@ -263,6 +263,11 @@ impl App<'_> {
if self.timing_enabled { self.timing.on_redraw_end(t0); }
}
Err(ref e) if e.kind() == std::io::ErrorKind::WouldBlock => {
// A draw can fail after partially writing to the terminal. In that case,
// the terminal contents may no longer match ratatui's back buffer, and
// subsequent diff-based draws may not fully repair stale tail lines.
// Force a clear on the next successful frame to resynchronize.
self.clear_on_first_frame = true;
// Non‑blocking draw hit backpressure; try again shortly.
if used_nonblocking {
tracing::debug!("nonblocking redraw hit WouldBlock; rescheduling");