Skip to content

fix: repaint immediately when a tab closes on shell exit#1688

Open
cantona wants to merge 2 commits into
raphamorim:mainfrom
cantona:fix/repaint-on-tab-close
Open

fix: repaint immediately when a tab closes on shell exit#1688
cantona wants to merge 2 commits into
raphamorim:mainfrom
cantona:fix/repaint-on-tab-close

Conversation

@cantona

@cantona cantona commented Jun 25, 2026

Copy link
Copy Markdown

With several tabs open, typing exit in a tab sometimes closed it instantly and sometimes left it frozen on screen (showing the dead shell) until you clicked another tab.

On shell exit 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 itself — it relied on that separate Render. If the Render was processed before CloseTerminal (or coalesced away), the post-close state was never painted, so the closed tab lingered until a later event forced a repaint.

Fix: mark_dirty() + request_redraw() in the CloseTerminal handler so the close is shown immediately, regardless of event ordering.

Standalone, based on main.

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.
@cantona

cantona commented Jun 25, 2026

Copy link
Copy Markdown
Author

Fix issue #1661

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