Repository navigation
Claude Code: caret cursor and no mouse clicks on prompts (mouse reporting never reaches xterm) #182
Copy link
Copy link
Closed
Description
Owner, 2026-10-11 (their words): "right now in claude code the cursor is always the caret cursor, it should be the normal cursor ... i cant use my cursor to click things, like when there comes permission prompts, you usually can use the mouse to click yes or no but now that doesnt work and you have to use your keyboard". Not sure whether it is permanent or comes and goes.
What was found (read-only code investigation, main at a38e05b, 2026-10-11)
Confirmed from code
- The caret is xterm's own default:
.xterm { cursor: text }, and.xterm.enable-mouse-events { cursor: default }only once xterm itself has accepted a mouse mode (DECSET 1000/1002/1003). No CSS incore/orsrc/sets a cursor. So a caret over Claude means xterm'smouseTrackingModeisnone: the mouse-on request never reached it. - Prism Terminal does not block it: every CSI handler it registers on those modes returns
false(passes through) (TerminalPanel.tsxclick-caret hooks, the A theme switch is never passed on to Claude (mode 2031 / DSR 997) #172 theme-mode hook, RIS), and the resume clear resets no modes. - It does not swallow clicks either: click-to-move-caret listens in capture but never calls
preventDefault/stopPropagation, and stands down when a program owns the mouse. - Claude Code does ask for the mouse here (
"tui": "fullscreen", noCLAUDE_CODE_DISABLE_MOUSE*). - The click direction was already known to fail on 2026-09-28:
wip/mouse-report-e2e(09e0dbc, never merged) adds amouseReporte2e and notes "without the win32-input-mode wrapping the bundled ConPTY ate the report whole". No wrapping code exists on any branch.
Likely, not yet verified
- The bundled ConPTY (node-pty's, 1.25.260303002) drops Claude's mouse-on request (ConPTY forwards it only when the program's console input is in VT mode), and drops raw SGR clicks on the way back. If so it is permanent for this Claude + ConPTY pair, not tied to a resize, a restored tab or a setting.
- Not obviously a regression from fix(core): Claude Code compatibility fixes (#167-#177) #178 (515d6d0). The one recent change that could matter is No XTVERSION reply, so Claude never turns on synchronized output (DEC 2026) #171 answering XTVERSION, which lets Claude detect the terminal; nothing found links it to the mouse.
To confirm first
- With Claude's full-screen view open, in DevTools:
document.querySelector('.xterm').classList.contains('enable-mouse-events'). - Log raw
term:dataand look for\x1b[?1000h/\x1b[?1006h. Absent: ConPTY dropped it. Present but no class: the fault is in xterm or the app. - Compare with Windows Terminal (and Tabby) on the same Claude version.
Fix direction
- Output side: get the request through (ConPTY / node-pty version, or upstream fix). The app must not switch mouse mode on by itself.
- Input side: when a program owns the mouse, send clicks in the form ConPTY accepts (win32-input-mode wrapped), in
core/(so Prism gets it, core bump). - Test: finish and merge the
mouseReporte2e from 09e0dbc, plus a check that.xtermhasenable-mouse-eventsand adefaultcursor after the probe turns mouse mode on, and a probe on Claude's real runtime (Bun), not only Node.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
Maxaubert commentedon Oct 11, 2026
Root cause found (2026-10-12): not the terminal, Claude Code's own fullscreen auto-disable
Measured in Prism Terminal (new e2e
mouseReport, PR to follow): a raw-mode program that turns mouse reporting on, as Claude Code's fullscreen view does, gets it. xterm takes the mode (enable-mouse-events, cursordefault, not the text caret), and a click reaches the program as an SGR press and release (ESC[<0;77;23M/ESC[<0;77;23m), under Node and under Bun (Claude Code's runtime). So the ConPTY theory above was wrong: ConPTY forwards the request and the clicks.What turned it off: Claude Code only asks for the mouse in its fullscreen TUI, and it switches that off by itself after repeated failed starts.
~/.claude.jsonholds:That is 2026-10-11 10:14, during the #180 startup investigation, when the packaged app was launched and killed many times while its restored Claude tabs were still booting. Each kill counted as "a previous fullscreen launch on this machine died before it was healthy". With fullscreen off, Claude Code never asks for the mouse: the text caret, and no clicks on AskUserQuestion. (From Claude Code 2.1.296's own strings: "fullscreen disabled: turned off on this machine after repeated failed starts (recorded sticky auto-disable, honoured at REPL mount) · /tui fullscreen or CLAUDE_CODE_NO_FLICKER=1 to override".)
The fix on this machine: run
/tui fullscreenonce in Claude Code. The record is also per Claude Code version, so the next update clears it.For the future: force-closing the app while restored Claude tabs are still starting counts against Claude Code's fullscreen. Installs and test launches should let a launch settle before closing it.
docs: Claude Code's caret and dead clicks, and how to read its fullsc…
test(e2e): a program that asks for the mouse gets it, under Node and …
Maxaubert commentedon Oct 12, 2026
Resolved: the caret and missing mouse came from Claude Code's fullscreen mode having been auto-disabled after failed starts (see the earlier comment and docs/diagnostics.md), not from the terminal. The mouseReport e2e merged in #192 holds that a program asking for the mouse gets it, under Node and Bun.