Skip to content

fix(tui): stop the alt-screen flicker at turn end - #160

Merged
jkyberneees merged 1 commit into
mainfrom
fix/turn-end-flicker
Oct 18, 2026
Merged

jkyberneees merged 1 commit into
mainfrom
fix/turn-end-flicker

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Problem

The screen flashed right as a turn ended (as the turn stats painted). The attention layer — window title (always on), bell, OSC 9 notify — wrote its escape sequence via tea.Exec, which releases and restores the terminal: it leaves the alt-screen and repaints. That fired on every done, and on approval / background-job alerts too.

Fix

attentionCmd is now a plain tea.Cmd that writes the sequence straight to stdout (same helper as the Shift+Enter key-mode writes). The stdout file's write lock serializes it with the renderer's frame writes, so frames can't interleave. OSC 52 clipboard copy still uses tea.Exec (copy-only, unchanged).

Tests

  • TestAttentionCmdWrapsTheRawWrite now asserts one verbatim write and no returned message (no exec/release) — regression guard.
  • make fmt, make vet, make lint (0 issues), make test (race) all green.

🤖 Generated with Claude Code

The attention layer (window title, bell, OSC 9 notify) wrote its
sequence through tea.Exec, which releases and restores the terminal —
leaving the alt-screen and repainting — on every done, approval and
background-job alert. Write the sequence directly to stdout from a
plain tea.Cmd instead; the file's write lock serializes it with the
renderer's frame writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bodek b709a95 Commit Preview URL

Branch Preview URL
Oct 18 2026, 07:23 AM

@jkyberneees
jkyberneees merged commit feb1193 into main Oct 18, 2026
9 checks passed
@jkyberneees
jkyberneees deleted the fix/turn-end-flicker branch October 18, 2026 07:26
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