From 0d5ffb000e190a4666337de24d9bcad8ba443eb8 Mon Sep 17 00:00:00 2001 From: Jeremy Rose <172423086+nornagon-openai@users.noreply.github.com> Date: Tue, 2 Sep 2025 16:14:47 -0700 Subject: [PATCH] tui: fix occasional UI flicker (#2918) occasionally i was seeing some minor flickering when adding history lines. hopefully this clears it up. --- codex-rs/tui/src/tui.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codex-rs/tui/src/tui.rs b/codex-rs/tui/src/tui.rs index 51828771..df957fee 100644 --- a/codex-rs/tui/src/tui.rs +++ b/codex-rs/tui/src/tui.rs @@ -252,10 +252,10 @@ impl Tui { if next_deadline.is_none_or(|cur| at < cur) { next_deadline = Some(at); } - if at <= Instant::now() { - next_deadline = None; - let _ = draw_tx_clone.send(()); - } + // Do not send a draw immediately here. By continuing the loop, + // we recompute the sleep target so the draw fires once via the + // sleep branch, coalescing multiple requests into a single draw. + continue; } None => break, }