[Bug] File suggester fails to dismiss after space/newline, causing ENTER to overwrite final word instead of submitting prompt
What's Wrong?
File suggester fails to dismiss after space/newline, causing ENTER to overwrite final word instead of submitting prompt.
When a user references a path using @~/some/path/ (trailing space) and continues typing a prompt , the autocomplete suggestion context fails to dismiss. Because the suggester remains active, pressing ENTER to submit the prompt is instead trapped by the autocomplete handler, which replaces the last typed word of the query with a path completion.
Steps to Reproduce & Behavioral Matrix
Objective: Reference a directory and ask a question (e.g., @~/some/path/ some question).
The input sequence is prefaced with @~/some/path/
| Input Sequence | Input State | Desired State | Actial State (if different) | Desired Behaviour | Current Behaviour |
| :---------------------------------------------------- | :------------------------------ | :-------------------------------------- | :----------------------------------------------- | :------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| ENTER | @~/some/pa | @~/some/path/ | | Completes the path. | ✅ Completes the path, even with spaces such as @~/some/path with spaces/ |
| [Space] | @~/some/path/ | @~/some/path/ | | Dismisses suggester, since paths with spaces don't quite work with the autocomplete anyways. | ❌ Dismisses the suggester. |
| [Space] + ENTER | @~/some/path/ | @~/some/path/ | | Submits the promot. | ❌ Dismisses the suggester, but does not submit the prompt. |
| [Space] + [Any Char/Word] + ENTER | @~/some/path/ a question | @~/some/path/ a question | @~/some/path/ a @~/some/path/__pycache__/ | Submits the prompt. | ❌ Suggester stays active. ENTER overwrites the final word. |
| SHIFT+ENTER (Newline) | @~/some/path/ | @~/some/path/<br>\n (empty newline) | | Dismisses suggester. | ❌ Suggester stays active. |
| SHIFT+ENTER (Newline) + [Any Char/Word] + ENTER | @~/some/path/<br>a question | @~/some/path/<br>a question | @~/some/path/<br>a @~/some/path/__pycache__/ | Dismisses suggester, submits the prompt. | ❌ Suggester stays active across newlines. ENTER overwrites the final word on the new line. |
Current Workaround
To bypass the active state trap, users must manually dismiss the suggester before continuing their query:
- Type
@/intended/dir/+(space). - Workaround: Press
ENTER(to dismiss). - Type the remainder of the prompt.
- Press
ENTERagain to submit.
Claude Code Version
2.1.185
Terminal/Shell
Observed in, not limited to; kitty, VSCode, konsole, alacritty
Operating System
Ubuntu/Debian Linux
Feedback ID: 7392d4f0-94da-404c-bc80-75f8c611ce14