[FEATURE]
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Problem
When using Claude Code in Windows Terminal with experimental.repositionCursorWithMouse enabled, clicking within the input box moves the cursor by only 1 character instead of jumping to the clicked position.
This works correctly in the regular PowerShell prompt (with shell integration enabled), but not within Claude Code's input area.
Environment
- Claude Code version: (run
claude --version) - OS: Windows 11
- Terminal: Windows Terminal (latest from MS Store)
- Shell: PowerShell 7.5.4
Expected Behaviour
Clicking within the input text should position the cursor at the click location, consistent with:
- Regular shell prompts (when shell integration is enabled)
- Other terminal applications (vim, etc.)
Current Behaviour
Clicking moves the cursor by exactly 1 character regardless of click position.
Notes
Similar issues have been reported for macOS (#7817, #7360). This request is specifically for Windows Terminal support.
Windows Terminal's experimental.repositionCursorWithMouse emits cursor key sequences — Claude Code's Ink-based TUI would need to handle these appropriately.
Proposed Solution
Handle the cursor key escape sequences that Windows Terminal emits when experimental.repositionCursorWithMouse is enabled.
When a user clicks within the input box, Windows Terminal calculates the offset and sends a sequence of left/right arrow key codes to move the cursor to that position. Claude Code's Ink-based input handler should interpret these sequences to reposition the cursor accordingly, rather than treating them as single character movements.
This would align behaviour with how the feature already works in regular shell prompts when shell integration is enabled.
Alternative Solutions
_No response_
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗