Slash command autocomplete can select the wrong command after fast typing
Status Open
Maintainer reply None cached
Activity 0 comments · opened Sep 18, 2026
Description
When typing a slash command quickly and pressing Enter before the autocomplete list finishes filtering, the wrong command can be inserted or executed.
Steps to reproduce
- Open the prompt in the terminal UI.
- Type
/coand immediately press Enter while the suggestion list is still updating. - Observe that a command other than the intended one is selected.
Expected behavior
Enter should run the command matching the current input, or wait until the suggestion list has settled before accepting a selection.
Actual behavior
The stale suggestion is accepted and the wrong command runs.
Environment
- Claude Code: latest
- OS: Linux
- Terminal: any
Notes
Likely a race between the debounced filter and the key handler. A small guard that ignores Enter until the list matches the current input would fix it.