[Bug] UI rendering broken with overlapping text and buffer corruption in v2.1.202
Bug Description
Claude Code 2.1.202 — overlapping/garbled TUI rendering inside tmux
The TUI renders with overlapping text — output lines are drawn over one another, and typed characters overlap at the input prompt (new content painted without erasing the old). Occurs only inside tmux; a bare iTerm2 session (no tmux) renders cleanly. Appeared after updating Claude Code — suspected renderer regression (new text drawn over stale cells rather than clear-then-draw; a cursor-position / clear-to-EOL / wrap disagreement, distinct from a "blank pane" stuck-frame).
Environment Info
- Platform: darwin
- Terminal: tmux
- Version: 2.1.197
- Claude Code: 2.1.202
- tmux: 3.7b
- Terminal: iTerm2 3.6.11, macOS (Apple Silicon, Darwin 24.6.0)
- TERM outside tmux: xterm-256color; inside tmux: tmux-256color
- tmux truecolor enabled (terminal-overrides ",xterm*:Tc")
- Feedback ID: 41a4d52d-c8bf-4b1b-9227-bd5b30feb05e
Repro
tmux -L cctest -f /dev/null new-session # clean tmux, no user config
claude # inside the tmux pane
Let output scroll and type in the input box; characters/lines overlap.
Not synchronized-output terminfo: tmux answers DECRQM mode 2026 "supported" regardless of terminal-overrides (Sync@ stripping has no effect), so a terminal-side sync toggle isn't available — a Claude-Code-side rendering/sync toggle or downgrade is the only lever.
Errors
[]
4 Comments
The following was attempted, no effect
tmux/.config/tmux/tmux.conf:
Reproducible on 2.1.202, macOS (Darwin 25.5.0), Apple Terminal, inline renderer (
"tui": "default"— deliberately not the fullscreen manager, I want native terminal scrollback), non-ASCII (Cyrillic) input.Trigger pattern: typing a new message while the assistant is mid-turn (long "…" spinner with tool calls streaming). The corruption is not just overlapping blocks — individual typed characters get spliced into the rendered tool-output lines at wrong buffer positions.
Example from my session (screenshot attached below): while I typed a Cyrillic sentence during streaming, the rendered issue-list line
was displayed as
— the interleaved
н/с/к/аare letters from the words I was typing into the prompt at that moment. Additionally: my queued input lines render twice (once merged with fragments of an earlier message), and dark background blocks stick to parts of output lines. The transcript itself stays intact (ctrl+o / resume shows clean text) — display-only.Happy to provide more repro details.
the picture is below
<img width="1998" height="706" alt="Image" src="https://github.com/user-attachments/assets/7028dcbc-4b67-4914-9aab-cd4a17f37164" />
Correction to my earlier comment —
CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT=1does not fix this. I misattributed it; that flag targets the Windows Terminal/ConPTY coalescing bug, a different class.What I've since ruled out on 2.1.202 / tmux 3.7b / iTerm2 3.6.11 (macOS, Apple Silicon), each verified with the var actually present in the process:
CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT=1— no effect.CLAUDE_CODE_FORCE_SYNC_OUTPUT=0— no effect. If that indeed disables synchronized output, then DEC-2026 sync is not the cause.CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1(equivalently"tui": "default") — changes the failure mode: the overlapping text goes away and scrolling is restored, but new output still doesn't paint until the tmux pane loses and regains focus. So dropping fullscreen mitigates the corruption, but a repaint-on-focus dependency remains.Net: the corruption lives in the fullscreen alt-screen renderer's cell positioning under tmux (reads like a cursor / clear-to-EOL / wrap disagreement), not synchronized output — disabling sync doesn't help, and only disabling the alternate screen changes anything. Even then it isn't clean.
Repro is unchanged (
tmux -L cctest -f /dev/null new-session, thenclaude, let output scroll / type). Happy to run debug flags (CLAUDE_CODE_DEBUG_REPAINTS?) if that would help narrow it down.