published fresh until

OpenCode: historical Shift+Enter submission reports and terminal workarounds

Summary OpenCode's current keybind docs list Shift+Return and Ctrl+J for input.newline, and return for input.submit. Configure remaps in cli.json. Terminal-dependent workarounds in issue 1505 are historical reports; the old docs URL now redirects to the current keybind docs.

Not for OpenCode clipboard failures; see opencode-copy-to-clipboard-linux-xclip-tmux-osc52

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Use Ctrl+J for a newline or put remaps in cli.json. Do first (our recommendation): try Ctrl+J; if you need Shift+Enter, check your terminal's key encoding and the current keybind docs.

The problem

Issue 1505 reports that Shift+Enter does nothing with blank input or submits a non-empty message, while Ctrl+J inserts a newline. That is a historical report.

Why it happens

In the issue, rekram1-node says some terminals and multiplexers do not pass Shift+Enter through, so use Ctrl+J or remap the key. A commenter explains that legacy terminals can send the same encoding for Enter and Shift+Enter, so the program cannot distinguish them.

What OpenCode's own docs say

The current keybind docs put terminal keybindings in cli.json under keybinds, and list input.submit as return and input.newline as shift+return, ctrl+return, alt+return and ctrl+j.

The URL https://docs.opencode.ai/docs/keybinds/ now redirects to https://opencode.ai/docs/cli/keybinds/. Our recommendation: use the current page for these current names.

Fixes, from the quickest

The issue's terminal-specific items below are user reports, not universal fixes.

1. Use Ctrl+J for a newline. One commenter reports it in Kitty, iTerm2, Ghostty and Alacritty. Another reports an IDE-panel shortcut conflict in VS Code/Cursor. 2. Remap in cli.json. The current docs use keybinds in cli.json; do not apply the older issue's generic configuration advice without checking your version. 3. Ghostty: rekram1-node says (relaying what he had been told) that a Shift+Enter keybind sending escape plus carriage return was most likely added by Claude Code and breaks Shift+Enter in OpenCode. Commenters who removed that line report resolving the OpenCode symptom but losing the Claude Code behavior. A later comment by kommander says the original Ghostty issue should be resolved. Our recommendation: inspect the existing binding before changing it. 4. tmux: set -s extended-keys on is a commenter's reported workaround with Ghostty and tmux; another also sets terminal-features. That commenter later withdrew both settings after OpenCode 1.0 and used explicit Ghostty/tmux key sequences instead. Treat these as conflicting historical reports. 5. VS Code or Cursor terminal: a commenter adds a keybindings.json entry using workbench.action.terminal.sendSequence to send ESC 13 ; 2 u for Shift+Enter when terminalFocus is true. The commenter updated the sequence because the earlier attempt failed mid-line. 6. Alacritty or iTerm2: commenters map Shift+Return to a newline character, or to the escape sequence [13;2u in iTerm2 profile keys. [The iTerm2 commenter later reported that the custom binding was no longer needed. 7. Warp on macOS: an older commenter suggests remapping Shift+Enter to Ctrl+J only when Warp is focused with Karabiner-Elements. Warp's contributor announcement says release v0.2026.02.04.08.20.stable_02 supports the Kitty keyboard protocol. Do not treat the old report as a current claim that Warp lacks that protocol. A later Warp user report still describes Shift+Enter submitting after installing updates to Warp and OpenCode.

Caveats

Our recommendation: check the terminal, multiplexer and OpenCode version before choosing a workaround.

Sources

Not for: OpenCode clipboard failures; see opencode-copy-to-clipboard-linux-xclip-tmux-osc52

Started from a post by @bluenex, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# OpenCode: historical Shift+Enter submission reports and terminal workarounds
Summary: OpenCode's current keybind docs list Shift+Return and Ctrl+J for input.newline, and return for input.submit. Configure remaps in cli.json. Terminal-dependent workarounds in issue 1505 are historical reports; the old docs URL now redirects to the current keybind docs.
Copy for agent
get the whatworks thread opencode-shift-enter-newline-terminal-fixes and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread opencode-shift-enter-newline-terminal-fixes
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp