Skip to content

desktop: make composer Enter / Cmd+Enter behavior configurable #55341

Closed as duplicate

Description

@labtopSir

Summary

The desktop app hardcodes the composer key bindings: Enter always submits and Shift+Enter always inserts a newline. There is no setting, and the desktop app does not read the keybinds block from cli.json, so desktop users cannot switch to the Enter = newline / Cmd+Enter = submit layout that the TUI already supports.

Environment

  • opencode version: 2.0.28 (desktop app build, [email protected])
  • OS: Darwin 27.0.0 (darwin arm64), macOS
  • Install/channel: release (downloaded app bundle, /Applications/OpenCode.app)
  • Active plugins: none configured

Current Behavior

The composer input handles keydown with a fixed rule:

  • Enter (no modifier) → submit
  • Shift+Enter → newline
  • Cmd/Ctrl+Enter → "alternate" submit, which steers or queues the prompt depending on Settings → General → Follow-up behavior
  • Cmd/Ctrl+ArrowUp → edit the first queued prompt

There is no UI to remap any of these. I checked every row registered by the desktop settings screen (settings.general.row.*, settings.appearance.row.*, settings.general.notifications.*, settings.general.sounds.*, settings.timeline.*); there is no keyboard or "Enter key behavior" section.

The TUI already solves this through ~/.config/opencode/cli.json:

{
  "keybinds": {
    "input.submit": "super+return",
    "input.newline": "return"
  }
}

That file is terminal-only and is not read by the desktop app, so the configuration has no effect there.

Reproduction

  1. Open OpenCode desktop and start a session.
  2. Focus the composer input.
  3. Press Enter.
  4. The prompt is submitted immediately; a newline cannot be inserted with Enter.
  5. Open Settings and look for any keyboard / Enter-key option — none exists.
  6. Add the keybinds block above to ~/.config/opencode/cli.json and restart the desktop app — behavior is unchanged.

Expected Behavior

Desktop users should be able to choose how Enter and Cmd/Ctrl+Enter behave in the composer, for example:

  • Submit mode (current default): Enter submits, Shift+Enter inserts a newline.
  • Newline mode: Enter inserts a newline, Cmd/Ctrl+Enter submits.

Ideally this lives in Settings → General, or the desktop app reads the same keybinds entries that the TUI already uses (input.submit, input.newline) so a single config works across both clients.

Additional Context

  • This is a feature request rather than a bug; the current behavior is self-consistent, just not configurable.
  • It is consistently reproducible on every launch, not intermittent.
  • Workaround: run the TUI via opencode in a terminal, where the existing cli.json keybinds configuration works as expected. Not a good workaround for users who prefer the desktop UI.
  • Cmd+Enter is already spoken for by the alternate-submit (steer/queue) action, so a "newline mode" would need to decide how that action is reachable. One option is to keep Cmd+Enter as alternate-submit only while a session is actively running, and as plain submit when idle.
  • Verified by inspecting the shipped bundle (/Applications/OpenCode.app/Contents/Resources/app.asar), build [email protected]. No private paths, tokens, or project data are included here.

Activity

  1. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed write-up! I think this is a duplicate of #43088, which asks for the same thing for the current desktop/web app: configurable submit, newline and alternate-submit (steer/queue) shortcuts, so that Enter can insert a newline and Cmd/Ctrl+Enter can submit.

    Possible duplicates and related issues, most likely first:

    If you'd like this, please add a 👍 or a comment on #43088. The bot will close this issue as a duplicate in 1 day unless you reply explaining how your request is different.

  2. labtopSir commented on Oct 14, 2026

    @labtopSir
    Author

    Confirmed duplicate of #43088 — added my 👍 there.

    One extra data point that may be useful for the main issue: the TUI already supports this layout today via ~/.config/opencode/cli.json:

    {
      "keybinds": {
        "input.submit": "super+return",
        "input.newline": "return"
      }
    }

    But cli.json is terminal-only and is not read by the desktop app, so desktop users currently have no path to this layout at all.

    Worth flagging that the #43128 description states "App and TUI settings remain separate", so even once that implementation lands the TUI keybind config still will not apply to the app. #43897 covers that specific part.

    No objection to closing this one as a duplicate.

  3. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Thanks for confirming and for adding your 👍 to #43088. You're right that these are two separate requests. #43088 / #43128 would make the shortcuts configurable inside the desktop app. #43897 covers the desktop app reading the same input.submit / input.newline keybinds as the TUI (cli.json). If that shared config matters to you, it's worth adding your note there too. The bot will close this issue as a duplicate as planned.

  4. opencode-agent commented on Oct 15, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #43088, as discussed. Thanks again for the detailed report and for adding your 👍 there. Please follow #43088 for configurable composer shortcuts in the desktop app, and #43897 for the desktop app reading the same input.submit / input.newline keybinds as the TUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions