Skip to content

fix(tui): allow Enter to submit when no autocomplete matches - #11970

Closed
hiromesh wants to merge 2 commits into
anomalyco:devfrom
hiromesh:fix/tui-slash-path-input
Closed

hiromesh wants to merge 2 commits into
anomalyco:devfrom
hiromesh:fix/tui-slash-path-input

Conversation

@hiromesh

@hiromesh hiromesh commented Feb 3, 2026 •

Copy link
Copy Markdown

Fixed a bug where typing paths starting with / (like /home/user/file.txt read this file) in the TUI input would show "No matching items" and block the Enter key from submitting. fix #11965

Root cause: The return key handler in autocomplete.tsx unconditionally called select() and e.preventDefault(), even when there were no matching options. This prevented form submission.

Fix: Only intercept Enter when options().length > 0. When no commands match (user is typing a path), close the autocomplete panel and let the normal submit handler process the input without preventing default behavior.

Tested by inputting /Users/hiro/opencode/README.md tell me what the file says in TUI:

  • Can type the full path
  • Shows "No matching items" when no commands match
  • Pressing Enter submits the input successfully
  • Command autocomplete still works for actual commands like /models

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI blocks path input starting with / due to command matching

1 participant