Slash-command dropdown should open after whitespace, not only at start of prompt

Resolved 💬 2 comments Opened May 6, 2026 by AayushAtAthelas Closed Jun 8, 2026

Summary

The full slash-command dropdown (the multi-row two-column listing of every command with its description) only appears when / is the first character of the prompt. When / is typed mid-prompt, only a lighter inline suggestion shows — the rich dropdown is unreachable.

Repro

  1. Open a Claude Code prompt.
  2. Type /. Full dropdown appears with all commands + descriptions.
  3. Clear, then type please run /. No full dropdown — only a lighter inline suggestion.

Expected

The full dropdown should also open mid-prompt, anywhere / is preceded by whitespace, a newline, or start-of-input. Same rendering, filtering, keybindings, and selection behavior as the start-of-prompt dropdown.

Trigger rule (precise)

Open the dropdown when:

  1. Char at cursor's left is /.
  2. Char immediately left of that / is one of: nothing (start-of-input), space, tab, or newline.
  3. Normal prompt-input mode (not in a paste, modal, etc.).

Applies on any line of a multi-line prompt.

Filter query

The non-whitespace run between the triggering / and the cursor.
Example: please run /use-w| → query is use-w.

Edge cases (must NOT trigger)

  • https://.../ preceded by :, not whitespace
  • src/foo.ts/ preceded by c, not whitespace
  • and/or/ preceded by d, not whitespace

Edge cases (MUST trigger)

  • / at start of prompt (regression check)
  • please /
  • After Shift+Enter, on a new line: \n/
  • Any later line of a multi-line prompt: ... /

Dismissal (mirror existing start-of-prompt behavior)

  • Esc closes it
  • Typing whitespace closes it (query run ends)
  • Cursor moves out of the query run
  • Backspace past the triggering /

Selection semantics

Selecting a command replaces /<partial query> with /<full command name> in place. Text before and after the cursor is preserved. The mid-prompt /command-name is not auto-invoked — invocation semantics stay unchanged (only start-of-prompt slashes invoke). This is purely a UI/discoverability change.

Why this should be small

The activation predicate for the existing start-of-prompt dropdown likely just needs to be broadened from cursor at col 0 AND char-left is / to char at trigger pos is / AND (trigger at col 0 OR char-left-of-trigger is whitespace). Rendering, filtering, keyboard handling, and selection are reused unchanged. The existing start-of-prompt case still satisfies the broadened predicate, so regression risk is low.

View original on GitHub ↗

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