From c6e9b05bea8c43426b5e5fd075f7497d101872b8 Mon Sep 17 00:00:00 2001 From: Su Kang Yin Date: Sat, 27 Jun 2026 00:24:14 +0800 Subject: [PATCH] fix(ui): repaint immediately when a tab closes on shell exit When a tab's shell exits, the PTY thread sends CloseTerminal(route_id) and a separate Render. The CloseTerminal handler closed the tab and resized the strip but never requested a redraw of its own -- so if the Render was processed first (or coalesced), the closed tab lingered on screen showing the dead shell until a later event (e.g. clicking another tab) forced a repaint. Mark dirty + request redraw in the close handler so the post-close state is presented immediately. --- frontends/rioterm/src/application.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontends/rioterm/src/application.rs b/frontends/rioterm/src/application.rs index 91e64177af..f1e9823aa6 100644 --- a/frontends/rioterm/src/application.rs +++ b/frontends/rioterm/src/application.rs @@ -668,6 +668,14 @@ impl ApplicationHandler for Application<'_> { } else { let size = route.window.screen.context_manager.len(); route.window.screen.resize_top_or_bottom_line(size); + // Force a repaint of the post-close state. The PTY + // thread also queues a separate Render, but if that is + // processed before this CloseTerminal (or coalesced), + // the closed tab lingers on screen until some later + // event — looking "frozen" until you click another + // tab. mark_dirty + redraw makes the close show now. + route.window.screen.mark_dirty(); + route.request_redraw(); } } }