opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Shift+Enter line break not working in Warp terminal (only Ctrl+J works)

Open realsamrat opened this issue 3 weeks ago • 2 comments

Description

Environment

  • OpenCode version: 1.0.180
  • Terminal: Warp
  • OS: macOS

Problem

Shift+Enter does not insert a line break in the input when running OpenCode inside the Warp terminal. The expected behavior is that Shift+Enter should create a new line, allowing multi-line input before submitting. Current Behavior

  • Pressing Shift+Enter does nothing (no line break inserted)
  • Only Ctrl+J works as a workaround for inserting line breaks

Expected Behavior

Shift+Enter should insert a line break in the input field, consistent with behavior in other terminals.

Workaround

Using Ctrl+J instead of Shift+Enter successfully inserts a line break.

Additional Context

This may be related to how Warp handles key bindings or how OpenCode captures keyboard input. Other terminals may not have this issue.

OpenCode version

1.0.180

Steps to reproduce

  1. Open Warp terminal
  2. Run OpenCode (version 1.0.180)
  3. Start typing a message
  4. Press Shift+Enter to insert a line break
  5. Observe: nothing happens

Screenshot and/or share link

No response

Operating System

MacOS

Terminal

Warp

realsamrat avatar Dec 21 '25 00:12 realsamrat

This issue might be a duplicate of existing issues. Please check:

  • #4046: Shift-return does not input newline since 1.0 (Ghostty/macOS Terminal)
  • #2960: Terminal TUI does not insert a new line with Shift+Enter; only Ctrl+J works
  • #4168: Shift-Enter sends message instead of adding newline (Wezterm)
  • #3599: shift+enter works as enter - submits (tmux/default config)
  • #5458: Modifying keybinds.input_newline has no effect (Windows Terminal)

Feel free to ignore if your specific Warp terminal case is different from these.

For keybind-related issues, please also check our pinned keybinds documentation: #4997

github-actions[bot] avatar Dec 21 '25 00:12 github-actions[bot]

Warp does not support modifyOtherKeys or kitty keyboard protocol. Warp will only work when it supports it, see Warp issues like these:

https://github.com/warpdotdev/Warp/issues/2037
https://github.com/warpdotdev/Warp/issues/2528

The only thing you can do is adding a custom keybinding for shift+enter to send \n. See something like this: https://github.com/warpdotdev/keysets/tree/main

kommander avatar Dec 21 '25 02:12 kommander