[BUG] Cannot Move Cursor Up/Down Across Lines When Inside File Mention in Prompt Input

Resolved 💬 2 comments Opened Jun 16, 2025 by unsu0707 Closed Nov 30, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: <!-- output of claude --version --> 1.0.24 (Claude Code)
  • Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 --> macOS 15.4.1(24E263)
  • Terminal: <!-- e.g. iTerm2, Terminal App --> terminal in Cursor IDE, Terminal App

Bug Description

<!-- A clear and concise description of the bug -->
When editing a prompt in the CLI, if a file mention (e.g., @path/to/file.py) is inserted in the middle of a multi-line input, the cursor navigation with arrow keys becomes unintuitive and cumbersome.
Specifically, if you move the cursor into the middle of a file mention using the arrow keys, you cannot easily move the cursor up or down to the previous/next line. Instead, the arrow keys only navigate through the file mention suggestion candidates below, and you have to use left/right keys to escape the mention and return to normal text navigation. This breaks the natural text editing flow.

Steps to Reproduce

  1. Start editing a multi-line prompt in the Claude CLI that includes an actual file mention, such as:

hello world hello world hello world\
This @path/path/path/path/path/path/file\_name\_filename.py file's code,\
hello world hello world hello world
  1. Move the cursor (with arrow keys) into the middle of the file mention (@path/path/path/path/path/path/file_name_filename.py).
  2. Attempt to move the cursor up or down using the arrow keys.

Expected Behavior

  • I expect to be able to freely move the cursor up or down to the previous or next line, even if the cursor is in the middle of a file mention.

Actual Behavior

  • When the cursor is inside a file mention, pressing up or down arrow keys only moves the selection between file mention suggestions shown below the input area, rather than moving the cursor within the text.
  • To move the cursor to another line, I have to use the left/right arrow keys to exit the mention first, which is cumbersome, especially when editing longer prompts with multiple file mentions.

https://github.com/user-attachments/assets/15d6c226-e3e8-4a2a-9203-dacb010638a8

Additional Context

<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
If a shortcut like Cmd(Ctrl) + Up/Down could be implemented to explicitly switch between "candidate navigation" and "text navigation", it would significantly improve usability for prompt editing.

Thank you!

View original on GitHub ↗

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