anomalyco / anomalyco/opencode

Shift+Enter frequently submits unfinished prompts instead of inserting a newline, wasting tokens

Open
#49,288 1 comment 0 reactions 1 assignee View on GitHub

@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
  1. Open a conversation in OpenCode 1.18.31.
  2. Start typing a prompt that needs multiple lines.
  3. Before finishing the prompt, press Shift+Enter to insert a newline.
  4. 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
  1. Open a conversation in OpenCode 1.18.31.
  2. Start typing a prompt that needs multiple lines.
  3. Before finishing the prompt, press Shift+Enter to insert a newline.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.