Skip to content

fix: defer image redraw after focus - #31

Merged
rrbe merged 2 commits into
masterfrom
fix/defer-focus-redraw
Aug 6, 2026
Merged

fix: defer image redraw after focus#31
rrbe merged 2 commits into
masterfrom
fix/defer-focus-redraw

Conversation

@rrbe

@rrbe rrbe commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • defer the focus-triggered full redraw until the terminal finishes restoring its graphics layer
  • cancel a pending redraw if focus leaves again before the delay expires
  • keep resize redraws immediate

Root cause

FocusGained is delivered reliably, but some terminals can still be restoring the active window or tab graphics layer at that point. The immediate clear, retransmit, and place sequence therefore succeeds at the protocol level and is then discarded by the terminal. A later keyboard event appears to fix it only because it triggers another render after activation has settled.

Verification

  • make check
  • make build
  • iTerm2 3.6.10: original issue reproduced; fixed build retained headings across 5 focus cycles
  • Ghostty 1.3.1: baseline lost the title after the first focus cycle; fixed build retained it across 5 cycles
  • Kitty 0.48.2: baseline and fixed builds both retained headings across 5 focus cycles

@rrbe
rrbe merged commit aff1b2d into master Aug 6, 2026
5 checks passed
@rrbe
rrbe deleted the fix/defer-focus-redraw branch August 6, 2026 07:06
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