You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tui: whitespace-preceded "/" opens autocomplete and blocks prompt submission #50604
In the TUI, any / that is preceded by whitespace opens the slash-command autocomplete and swallows Enter, so the prompt can never be submitted. It does not require the text to be a command — a normal sentence containing a spaced / is affected.
Because command options are only listed when the / is at offset 0, the popup just shows "No matching commands" mid-message, and Enter does nothing. It also happens when the spaced token is an actual command name.
Messages that cannot be sent, for example:
Do not use 'find /'
run /devices
A / should only be treated as a command when it is the first character of the prompt. The submit path already requires this (parseSlashHead returns early unless text.startsWith("/")), and the docs describe commands as starting with / ("Type / to list slash commands"), so the whitespace-preceded trigger is neither documented nor consistent with submission.
Steps to reproduce
Open the TUI (opencode) in any project.
Type a message containing a space followed by /, e.g. Do not use 'find /'.
The autocomplete popup opens with "No matching commands".
Press Enter. The message is not submitted; nothing happens.
Expected: the message submits normally. Actual: the popup opens and Enter is consumed by the autocomplete, so the prompt cannot be sent.
Notes
Likely source, on v2.0.13:
packages/tui/src/prompt/display.ts — slashTriggerIndex accepts a / whose preceding character is whitespace, anywhere in the prompt.
packages/tui/src/component/prompt/autocomplete.tsx — the autocomplete layer is enabled whenever that popup is visible and binds Enter to prompt.autocomplete.select; command options are gated on store.index === 0, so mid-message the list is empty and select() returns without submitting.
The dev branch looks already changed here (the trigger now requires value.startsWith("/") with no whitespace before the cursor), but v2.0.13 is the latest release and still has this behavior.
OpenCode version
2.0.13
Plugins
-opencode-pty, cc-safety-net@latest; local plugins devices, opencode-stats, ssh-remote
Operating System
Linux (Ubuntu on WSL2, x64) — kernel 5.15.153.1-microsoft-standard-WSL2
Taking this. The trigger is slashTriggerIndex in packages/tui/src/prompt/display.ts: it accepts any / that follows whitespace, but a command can only open the prompt (parseSlashHead returns early otherwise, and the autocomplete only lists options at offset 0). So the popup is always empty there, and its keymap layer consumes Enter. I'm making the trigger prompt-initial and updating the test that asserted the old behavior. PR to follow.
Activity
lucabattistini commentedon Sep 22, 2026
Taking this. The trigger is
slashTriggerIndexinpackages/tui/src/prompt/display.ts: it accepts any/that follows whitespace, but a command can only open the prompt (parseSlashHeadreturns early otherwise, and the autocomplete only lists options at offset 0). So the popup is always empty there, and its keymap layer consumesEnter. I'm making the trigger prompt-initial and updating the test that asserted the old behavior. PR to follow.