Repository navigation
Description
Summary
On mobile browsers, pressing Enter in the web UI prompt submits the prompt instead of inserting a newline. Mobile software keyboards (Gboard/Android) have no usable Shift key, so there is no way to compose a multi-line prompt at all. This is still present in v2.0.29.
Environment
- opencode version: 2.0.29 (npm global,
latest) - OS: server on Windows 11 Pro (10.0.26300); client is Android + Chrome (Gboard)
- Terminal: N/A — this happens in the web UI served by the opencode server, not the TUI
- Shell: N/A (shell is not involved)
- Install/channel: npm global, release channel
- Active plugins: local
~/.config/opencode/plugins/(session-sidebar,statusline,deny-ssh-when-delegated.js,orca-opencode-status.js) — none touch prompt input, so unrelated
Reproduction
- Run opencode so its server (web UI) is reachable from a phone.
- Open the web UI on Android Chrome and focus the prompt input.
- Type a line and press Enter on the virtual keyboard (no Shift available on mobile).
- Observe: the prompt is submitted immediately; a newline cannot be inserted.
Expected Behavior
On mobile, Enter should insert a newline so multi-line prompts can be composed, and submission should happen through the send button that is already present in the UI. (Desktop behavior — Enter submits, Shift+Enter inserts a newline — can stay as-is.)
Actual Behavior
Plain Enter submits the prompt. There is no keyboard combination available on a mobile soft keyboard (input.newline defaults to shift+return,ctrl+return,alt+return,ctrl+j), so a multi-line prompt is impossible.
Additional Context
Root cause appears to be in the web prompt input handler (packages/app/src/components/prompt-input.tsx, handleKeyDown): plain Enter is handled as submit unconditionally, with no mobile branch, while newline insertion is gated behind modifier keys that mobile keyboards cannot produce.
This looks like the same problem reported and closed-by-cleanup in #20965 (auto-closed as not planned on inactivity), and related to #15462, #16226 and the umbrella mobile issue #7990. #23430 proposes exposing prompt.submit / prompt.newline in the web Settings → Keyboard Shortcuts UI, which would let this be remapped; it is not merged, and v2.0.29 still behaves the same.
Notes on possible fixes:
cli.jsonkeybindsare documented as terminal-only ("CLI settings control the terminal clients only"), and there is noenterToSend-style setting, so this cannot be worked around by config.
Workarounds users currently have to rely on: composing the prompt elsewhere and pasting it, using an external Bluetooth/USB keyboard, or using a third-party mobile client.
It would help to either (a) detect coarse-pointer/mobile input and make Enter insert a newline, or (b) surface prompt.submit / prompt.newline in the web settings so users can swap them.
Activity
opencode-agent commentedon Oct 14, 2026
Thanks for the detailed report. I can confirm this on v2.0.29, and it still happens on the latest
dev(3943b84).What I did: I ran
opencode serveand opened the web UI in Chromium emulating an Android phone (touch, mobile,pointer: coarse). In a session, I tapped the prompt, typed "first line", pressed Enter and typed "second line". Enter sent "first line" as a prompt right away, and the box was left holding only "second line". No newline was inserted. The script below reproduces it, and the screenshots show the result.The composer's key handler (
packages/app/src/composer/editor/editor.tsx,onKeyDown) submits on any Enter without Shift, with no special case for touch or mobile.Related issues: #20965 (an earlier report, closed for inactivity), #43088 (configurable prompt shortcuts in the app) and #55341 (configurable Enter behaviour on desktop).
Reproduction script (mobile-enter.mjs)
Run it:
bun mobile-enter.mjskanswer commentedon Oct 18, 2026
I ran into this too and opened a PR: #56664
Plain Enter now inserts a line break in the composer when the device reports no hover pointer (phones/tablets), while the send button submits the whole prompt. It uses the same insertion path as desktop Shift+Enter, so multi-line prompts come through as a single prompt; desktop and
Mod+Enterbehavior are unchanged.joelrbrandt commentedon Nov 1, 2026
Just a heads up: on iOS 27 Safari with the default iOS keyboard, new lines can be entered in the composer by toggling "shift" on and then tapping enter.
It is possible that other iOS keyboards don't pass shift state through on sending the enter key.