[BUG] Fullscreen (no-flicker/alt-screen) renderer duplicates content lines on wrapped rows (macOS) — classic renderer is clean, A/B reproduced

Open 💬 2 comments Opened Jun 10, 2026 by stefanopochet

Summary

The fullscreen / no-flicker (alternate-screen) TUI renderer duplicates whole content lines and corrupts wrapped rows (a stray character spills into column 0 of the next row). The classic (tui: default) renderer does not have this. The corruption is in the emitted byte stream — it reproduces under independent, correct terminal emulators (pyte and agg), so it is not a specific terminal/GPU artifact.

Environment

  • Claude Code 2.1.170 (also observed on 2.1.168)
  • macOS (Darwin 25.5.0), Apple Silicon
  • iTerm2 3.6.11 — but reproduces headlessly under agg, so terminal-independent

Reproduction (controlled A/B)

I drove claude in a pty across 4 configs with the same long, heavily-wrapping prompt ("list the numbers 1–70, each with a long descriptive sentence"), captured the raw output, and replayed it through pyte and agg, counting content lines that appear 2+ times in the visible screen (excluding input-box borders):

| renderer | width | duplicated content lines |
|---|---|---|
| classic (tui: default) | 70 cols | 0 |
| classic (tui: default) | 120 cols | 0 |
| fullscreen (CLAUDE_CODE_NO_FLICKER=1) | 70 cols | 11 frames |
| fullscreen (CLAUDE_CODE_NO_FLICKER=1) | 120 cols | 3 frames |

The renderer is the determining factor; narrow width is only a secondary amplifier (more soft-wrapping → more occurrences). Example duplicated lines in fullscreen: 2. Il numero due è il primo numero pari…, 10…, 11… rendered twice.

Evidence it's in the bytes

Replaying the captured output through two independent correct emulators (pyte Screen, and agg's reference renderer) both reproduce the duplication and the column-0 spill on wrapped rows. Byte signature of the fullscreen path: heavy absolute cursor positioning (ESC[r;cH) + erase-to-EOL (ESC[K), zero scroll regions (DECSTBM) — consistent with a cursor-column miscalculation after a soft-wrap during full-frame repaints.

Why this hits users even with tui: default

Per the docs, Remote Control, agent-view, and attached/background sessions always use the fullscreen renderer regardless of the tui setting, and CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN does not apply to them. So users who configured tui: default still hit this in any Remote Control / agent-view session, which makes it look like the classic renderer is affected when it isn't.

Expected vs actual

  • Expected: each committed frame shows each content line once.
  • Actual (fullscreen): content lines drawn twice; wrapped rows spill a char into column 0.

Workaround

Use tui: default for direct terminal sessions (clean). No workaround for forced-fullscreen attached / Remote-Control / agent-view sessions.

Related

Possibly related: #49985, #53857.

I can share the captured .cast recordings and frame renders on request.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗