Arrow key navigation trapped in slash command autocomplete menu

Resolved 💬 3 comments Opened Nov 8, 2025 by hoiung Closed Nov 12, 2025

Bug Description

When typing a message and accidentally pressing the up arrow key (which is positioned near Enter), the slash command autocomplete menu appears (e.g., /clear with options /start or /compact). The arrow keys then become trapped in a loop cycling between the autocomplete options, making it impossible to navigate back down to the message being typed.

Steps to Reproduce

  1. Start typing a message in Claude Code CLI
  2. Accidentally press up arrow (easy to do since it's near Enter key)
  3. Slash command autocomplete appears (e.g., /clear with sub-options)
  4. Try pressing down arrow to return to the message being typed
  5. Bug: Arrow keys are now trapped cycling between /clear and /compact options
  6. Cannot escape back to the original message

Expected Behavior

When the autocomplete menu appears:

  • Down arrow should allow navigation OUT of the menu back to the typed message
  • ESC key should dismiss the menu and return to message input
  • There should be a way to exit the autocomplete loop

Current Behavior

  • Arrow down only cycles between autocomplete options (e.g., /clear/compact)
  • No way to navigate back to the message being typed
  • Keys are trapped in the autocomplete menu
  • User loses access to their partially typed message

Impact

  • High frequency: Easy to trigger accidentally (up arrow near Enter)
  • Complete blocker: Cannot recover the typed message
  • Lost work: Must abandon partially typed messages
  • Severe UX issue: Breaks basic text editing expectations

UI/UX Problems

  1. Poor key placement awareness: Up arrow very close to Enter invites accidents
  2. No escape mechanism: Once in autocomplete, no way out except completing/canceling command
  3. Navigation capture: Arrow keys commandeered by autocomplete without release
  4. No visual feedback: Unclear that you're "trapped" in a mode

Suggested Fixes

  1. Allow down arrow to exit autocomplete menu when at the last option
  2. Add ESC key to dismiss autocomplete and return to message
  3. Add a "back to input" option in the menu
  4. Don't trigger slash commands from up arrow - only from typing /
  5. Show clearer visual indication of being "in" autocomplete mode

Environment

  • Platform: Windows (win32)

This is a critical navigation/input mode issue that needs immediate attention.

View original on GitHub ↗

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