Problem
When Claude Code runs with CLAUDE_CODE_NO_FLICKER=1 (fullscreen mode), text renders garbled — fragments appear at wrong positions (e.g. "T.....al" instead of "Terminal"). Resizing the window temporarily fixes it.
Root Cause
PTY output reader sends fixed 4096-byte chunks. Claude Code's no-flicker mode uses dense cursor-positioning escape sequences. When a multi-byte escape sequence straddles a chunk boundary, it gets split — xterm.js receives two malformed fragments instead of one valid sequence.
Fix
- Client-side write batching with
requestAnimationFrame (~16ms) — split sequences rejoin before xterm.js parses them
- Increase PTY read chunk size from 4096 to 65536 bytes
Fixed in #119.
Problem
When Claude Code runs with
CLAUDE_CODE_NO_FLICKER=1(fullscreen mode), text renders garbled — fragments appear at wrong positions (e.g. "T.....al" instead of "Terminal"). Resizing the window temporarily fixes it.Root Cause
PTY output reader sends fixed 4096-byte chunks. Claude Code's no-flicker mode uses dense cursor-positioning escape sequences. When a multi-byte escape sequence straddles a chunk boundary, it gets split — xterm.js receives two malformed fragments instead of one valid sequence.
Fix
requestAnimationFrame(~16ms) — split sequences rejoin before xterm.js parses themFixed in #119.