Option+Click cursor positioning doesn't work in Claude Code input prompt
Description
Option+Click (Alt+Click) cursor positioning does not work correctly in the Claude Code CLI input prompt. Instead of jumping the cursor to the clicked position, it moves the cursor only one character in the direction of the click.
Environment
- Platform: macOS (Darwin 25.4.0)
- Terminal: iTerm2
- Shell: zsh
- Claude Code Model: claude-sonnet-4-5@20250929
- iTerm2 Option key setting: Normal
Steps to Reproduce
- Launch Claude Code CLI in iTerm2
- Type a long command or message in the Claude Code input prompt
- Hold Option (⌥) and click in the middle of the text
- Observe that the cursor moves only one character toward the click location instead of jumping to it
Expected Behavior
The cursor should jump directly to the clicked position, matching standard xterm mouse protocol behavior (as seen in regular shell prompts).
Actual Behavior
The cursor moves only one character in the direction of the click (left if clicking before cursor, right if clicking after cursor).
Verification
- ✅ Option+Click works correctly in normal shell (tested via \
!\shell escape) - ❌ Option+Click does NOT work in Claude Code input prompt
- ✅ iTerm2 "Left Option key" is set to "Normal" (not Esc+ or Meta)
- ✅ iTerm2 "Report mouse clicks & drags" is enabled
Impact
This breaks expected terminal behavior and makes it harder to edit long prompts efficiently. Users must fall back to keyboard-only navigation (Option+←/→ for word jumps, Ctrl+A/E for line edges).
Workaround
Use keyboard navigation:
- Option+← / Option+→ to jump by word
- Ctrl+A to jump to start of line
- Ctrl+E to jump to end of line
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗