Fullscreen TUI mode breaks terminal text copy in browser-based terminals (code-server/xterm.js) due to mouse-tracking capture
Environment
- Claude Code version: 2.1.199
- Terminal: code-server (VS Code web) integrated terminal, built on xterm.js
- Access: browser, plain HTTP (not a factor in root cause, ruled out separately)
~/.claude/settings.json:"tui": "fullscreen"(enabled via the recent upgrade prompt)
Bug
When "tui": "fullscreen" is enabled, selecting text with the mouse in
Claude Code's terminal output no longer performs native browser/terminal
text selection. Instead, a status hint appears:
send N chars via OSC 52. if paste fails, hold shift while selecting for native copy
Both Ctrl+C and right-click "Copy" fail to copy anything to the
clipboard, with no console errors. The suggested workaround (hold Shift
while selecting, or Shift while right-clicking) does not work in this
environment.
Root cause (as far as we could tell)
Fullscreen mode requests terminal mouse-tracking/mouse-reporting, so
mouse drag events are forwarded to Claude Code's renderer instead of
triggering native OS/browser text selection — the same mechanism used
by vim/htop/tmux-with-mouse-on. Claude Code then relies on an OSC 52
based clipboard write as the copy path.
The documented "hold Shift to bypass" escape hatch is a convention
supported by many native terminal emulators (iTerm2, Windows Terminal,
Kitty, etc.), but does not appear to be implemented by code-server's
bundled xterm.js terminal component. This leaves users of Claude Code
inside code-server (or other web-based IDE terminals using xterm.js)
with no way to copy terminal output while fullscreen mode is on.
Workaround
Removing "tui": "fullscreen" from ~/.claude/settings.json (or
otherwise reverting to inline rendering) restores normal native text
selection and copy, since Claude Code no longer requests mouse
tracking.
Suggested fixes
- Detect terminals/environments where the Shift-bypass convention isn't
supported and fall back more gracefully (e.g. don't suppress native
selection unless OSC 52 copy is confirmed to work).
- Document this known limitation for browser-based/xterm.js-hosted
terminals (code-server, Theia, etc.) so users know to disable
fullscreen mode there.
- Consider a keyboard-only copy command that works regardless of mouse
capture state (independent of terminal-specific Shift conventions).