TUI rendering crash dumps minified source to terminal when running in Emacs
TUI rendering crash dumps minified source to terminal
Environment
- Claude Code version: v2.1.63
- OS: macOS 15.7.3 (Darwin 24.6.0)
- Terminal: Running inside Emacs terminal emulator (
vterm/ansi-term) - Model: Opus 4.6 (1M context)
- Mode: Plan mode active, with a Plan subagent running
What happened
While a Plan subagent was executing (~6.5 minutes in, 17+ tool uses, 14k tokens consumed), the TUI rendering layer crashed. Minified JavaScript source code — specifically color theme definitions, chalk/ANSI wrappers, and the Ink border renderer — was dumped directly to stdout, followed by a Bun stack trace. The session became completely unresponsive after the crash.
Reproduction context
The crash occurred at the boundary between the status line and the input prompt area. The last successfully rendered output was:
✻ Booping… (6m 30s · ↓ 14.0k tokens)
────────────────────────────────────
❯
────────────────────────────────────
⏸ plan mode on (shift+tab to cycle) · esc to interrupt
Immediately after the status bar, minified JS began streaming to the terminal.
Dumped source (excerpt)
The output includes internal theme color definitions (_FOR_SUBAGENTS_ONLY color tokens, clawd_body, fastMode, etc.) and the Ink border rendering function (ydD), suggesting the React/Ink rendering pipeline crashed mid-render:
ed:"rgb(71,88,74)",diffRemovedDimmed:"rgb(105,72,77)",diffAddedWord:"rgb(56,166,96)",
diffRemovedWord:"rgb(179,89,107)",red_FOR_SUBAGENTS_ONLY:"rgb(220,38,38)",
blue_FOR_SUBAGENTS_ONLY:"rgb(37,99,235)",green_FOR_SUBAGENTS_ONLY:"rgb(22,163,74)",
...
clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",
userMessageBackground:"rgb(55, 55, 55)",
fastMode:"rgb(255,120,20)",fastModeShimmer:"rgb(255,165,70)"
Stack trace
- <anonymous> (/$bunfs/root/claude:240:98758)
- <anonymous> (/$bunfs/root/claude:240:98584)
- qT (/$bunfs/root/claude:241:264)
- t9 (/$bunfs/root/claude:241:3694)
- f_ (/$bunfs/root/claude:241:5250)
- <anonymous> (/$bunfs/root/claude:241:6762)
- insertChild (/$bunfs/root/claude:241:31095)
- yHA (/$bunfs/root/claude:241:36320)
- qg (/$bunfs/root/claude:227:64570)
- qg (/$bunfs/root/claude:227:64669)
The insertChild call in the Bun-bundled source (line 241) points to a React/Ink reconciler issue — likely a DOM node insertion during a render cycle that corrupted the output stream.
Impact
- Session becomes completely unresponsive (hung) after the crash
- The minified source dump pollutes the terminal buffer
- No graceful recovery is possible; must kill and restart
Possible contributing factors
- Emacs terminal emulator may report terminal capabilities differently than a native terminal (e.g.,
TERM,COLORTERM, window size) - Long-running subagent (6.5 min, 17+ tool uses) — possible memory pressure or state accumulation in the Ink render tree
- Plan mode — the UI may be managing multiple concurrent render regions (plan agent output + status bar + input prompt)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗