Skip to content

[FEATURE]: Allow to Shift + enter to edit in next line without enter #9836

Closed

Description

@jtorrex

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem: When composing multi-line messages in Opencode, pressing Enter sends the message immediately, making it difficult to write formatted code blocks or multi-line responses without using workarounds.

Requested Feature: Add support for Shift+Enter to insert a new line while keeping Enter as the send command.

Use Cases:

  • Writing multi-line code examples
  • Formatting markdown with line breaks
  • Composing structured explanations with paragraphs
  • Pasting code snippets with proper formatting

Expected Behavior:

  • Enter → Send message (current behavior)
  • Shift+Enter → Insert new line (new behavior)

This pattern is common in CLI tools and chat interfaces (e.g., ChatGPT, Discord, Slack) and would improve the user experience for composing complex multi-line content.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Jan 21, 2026
  2. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 21, 2026
  3. github-actions commented on Jan 21, 2026

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

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

  4. rekram1-node commented on Jan 21, 2026

    @rekram1-node
    Collaborator

    need to know your terminal, this should already work unless:

    • your terminal doesnt support it
    • your terminal needs to have configured modifiers so the tui can actually intepret it as a shift enter instead of enter
  5. ImTheDeveloper commented on Jan 21, 2026

    @ImTheDeveloper

    FWIW I upgraded ubuntu to 25.1 and seemingly this keybind broke completely in ghostty. After some digging it needed this added into ghostty config:

    keybind = shift+enter=text:\x1b\r
    

    Reload of terminal and opencode and it all worked again. This has been reported a few times on claudecode also with the same changes needed.

  6. diddletime commented on Jan 21, 2026

    @diddletime

    I tried this on multiple different terminals on windows but doesn't work at all. I thought I was going crazy because I thought it was strange that opencode missed a simple and important feature like this but I guess it's just broken or the terminals fault.

  7. rekram1-node commented on Jan 21, 2026

    @rekram1-node
    Collaborator
  8. mrt181 commented on Jan 22, 2026

    @mrt181

    @diddletime did u see this?

    https://opencode.ai/docs/keybinds/#windows-terminal

    this works for me with windows-terminal -> WSL2 -> tmux -> fish

  9. bdolewski-intellias commented on Jan 22, 2026

    @bdolewski-intellias

    The Shift+Enter for multiline doesn't work for me. I've got the same issue just like OP. My setup:

    • macOS: 26.2 (Build 25C56)
    • OpenCode: 1.1.31
    • Warp: 0.2026.01.14.08.15.04
  10. kstepien3 commented on Jan 27, 2026

    @kstepien3

    The Shift+Enter for multiline doesn't work for me. I've got the same issue just like OP. My setup:

    * **macOS**: 26.2 (Build 25C56)
    
    * **OpenCode**: 1.1.31
    
    * **Warp**: 0.2026.01.14.08.15.04
    

    same here. I don’t see any issue in implementing it, or even adding an option for users to test it.

  11. u1pns commented on Jan 27, 2026

    @u1pns

    Same issue on OnMacOS. I have to use CTRL+J.

  12. kstepien3 commented on Jan 27, 2026

    @kstepien3

    Same issue on OnMacOS. I have to use CTRL+J.

    I wasn’t aware of that. Thanks.

  13. kyconnol commented on Feb 5, 2026

    @kyconnol

    Same issue on OnMacOS. I have to use CTRL+J.

    Thank you for this! In case anyone's like me and remaps caps lock to ctrl - new line is working for me in Ghostty/Tmux on MacOS with:

    ctrl (physical caps lock) + shift + j

  14. XavierBeheydt commented on Feb 11, 2026

    @XavierBeheydt

    I have the same issue on :

    • Archlinux
    • Alacritty: v0.16.1 (42f49eeb)
    • Tmux: 3.6a
  15. 65 remaining items

  16. AyaSapphire commented on Jul 29, 2026

    @AyaSapphire

    @diddletime did u see this?

    https://opencode.ai/docs/keybinds/#windows-terminal

    I think the current solution described in the documentation has some side effects on Windows Terminal. Configuring Shift+Enter this way is effectively a "dirty workaround", as it overrides the terminal's existing key behavior. For terminals like PowerShell, Shift+Enter already works as a way to input multi-line commands.

    After applying the suggested configuration, however, Shift+Enter no longer behaves correctly and may insert literal characters such as [13;2u12 instead.

    It would be helpful if the documentation could mention this limitation, so users understand that this configuration may affect the default multi-line input behavior of some terminals.

  17. stewacide commented on Sep 26, 2026

    @stewacide

    This so much. Find this very annoying switching from Cursor to OpenCode (which has the option for Enter to submit or Enter for newline)

    Image
  18. neriousy commented on Oct 1, 2026

    @neriousy
    Member

    In OpenCode v2, Shift+Enter inserts a new line by default. input.newline defaults to shift+return, ctrl+return, alt+return and ctrl+j.

    Added in #41882; alt+return came in #43655.

    Some terminals don't send a separate Shift+Enter key sequence. For those, see https://opencode.ai/docs/keybinds/ and the keybind tracking issue #4997.

    Closing as completed.

  19. serhumanos commented on Oct 4, 2026

    @serhumanos

    This will be very useful; in most cases, I hit Enter to add a new line.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions