Option+Click cursor positioning doesn't work in Claude Code input prompt

Resolved 💬 3 comments Opened Mar 30, 2026 by mdproctor Closed May 4, 2026

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

  1. Launch Claude Code CLI in iTerm2
  2. Type a long command or message in the Claude Code input prompt
  3. Hold Option (⌥) and click in the middle of the text
  4. 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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗