anomalyco / anomalyco/opencode
Shift+Enter frequently submits unfinished prompts instead of inserting a newline, wasting tokens
@kommander is already working on this.
Since Sep 16, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Shift+Enter frequently submits unfinished prompts instead of inserting a newline, wasting tokens
Description
In OpenCode 1.18.31, Shift+Enter repeatedly fails to insert a newline and submits the message instead.
This causes prompts to be sent while I am still writing them. The model starts responding to incomplete instructions, so I have to interrupt the response, edit the prompt, and send it again.
This happens frequently enough to disrupt normal use and has wasted a significant number of tokens.
Steps to reproduce
- Open a conversation in OpenCode 1.18.31.
- Start typing a prompt that needs multiple lines.
- Before finishing the prompt, press Shift+Enter to insert a newline.
- Observe that the unfinished prompt is submitted instead.
The issue occurs repeatedly during normal use, although I have not isolated the exact conditions that trigger it.
Expected behavior
Shift+Enter should insert a newline and keep the draft in the input field so I can continue editing. It should not submit the prompt or start a model response.
Actual behavior
Shift+Enter submits the unfinished prompt. The model begins responding before I have finished providing the instructions.
Impact
- Unintended requests consume tokens before I can interrupt them.
- Editing and resending the prompt adds further token usage.
- Repeated interruptions break my workflow.
- Multiline prompt entry becomes unreliable because inserting a newline can unexpectedly send the message.
Environment
- OpenCode version: 1.18.31
- Operating system: macOS 27.0 (build 26A428)
- Architecture: Apple Silicon (arm64)
Additional context
The keybindings documentation lists Shift+Enter as a newline shortcut and also notes terminal compatibility considerations.
Similar behavior has been reported in #11983 and #8038, although those reports describe Windows environments. I have not confirmed whether this has the same underlying cause.
Please investigate why the newline shortcut is being interpreted as submission and how accidental submission of unfinished prompts can be prevented.
Plugins
No response
OpenCode version
1.18.31
Steps to reproduce
- Open a conversation in OpenCode 1.18.31.
- Start typing a prompt that needs multiple lines.
- Before finishing the prompt, press Shift+Enter to insert a newline.
- Observe that the unfinished prompt is submitted instead.
Screenshot and/or share link
No response
Operating System
macOS 27.0
Terminal
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.