Skip to content

How do you insert a new line into the prompt box? (using mac + ghostty) #2820

Closed as duplicate

Description

@epicwhale

For some reason, I can't introduce a line break in my input. Tried Ctrl + enter, Opt + enter, Cmd + enter - no luck. How do I type over multiple lines?

Tried in both ghostty and vs code terminal.

Able to do an Opt + Enter for line break in gemini-cli and claude-code successfully in the same environment.

❯ opencode --version
0.12.0

Activity

  1. github-actions commented on Sep 27, 2025

    @github-actions
    Contributor

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

    • shift+enter keybinding not working #1505: shift+enter keybinding not working - This issue describes similar problems with multiline input where shift+enter doesn't work to insert newlines, though it mentions ctrl+j works as an alternative

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

  2. rekram1-node commented on Sep 27, 2025

    @rekram1-node
    Contributor

    @epicwhale have u tried shift + enter?

    that is what i use and it should be the default

  3. self-assigned this
    on Sep 27, 2025
  4. epicwhale commented on Sep 27, 2025

    @epicwhale
    Author

    @epicwhale have u tried shift + enter?

    that is what i use and it should be the default

    Yes, sadly, does not work. Shift Enter simply sends the command. You will see this reported in other similar bugs mentioned too.

  5. epicwhale commented on Sep 27, 2025

    @epicwhale
    Author

    @epicwhale have u tried shift + enter?
    that is what i use and it should be the default

    Yes, sadly, does not work. Shift Enter simply sends the command. You will see this reported in other similar bugs mentioned too.

    @rekram1-node shift enter not working reported by another user too, same boat: #1505 (comment)

  6. rekram1-node commented on Sep 27, 2025

    @rekram1-node
    Contributor

    @epicwhale hmm works fine on my end, there could be other things in your system interfering?, I heard people using tmux have this often.

    Alternatives:

    • try cmd + j
    • use the "keybinds" in your config to remap it
  7. epicwhale commented on Sep 27, 2025

    @epicwhale
    Author

    @rekram1-node not using tmux. Oddly works in Claude code and Gemini CLI.. so I can't imagine what in the system would be intefering. The + j combination key works, but really find that unusual. Want a combo with enter.. struggling with getting a keybind to fix it too, sadly :(

    @epicwhale hmm works fine on my end, there could be other things in your system interfering?, I heard people using tmux have this often.

    Alternatives:

    • try cmd + j
    • use the "keybinds" in your config to remap it
  8. rekram1-node commented on Sep 27, 2025

    @rekram1-node
    Contributor

    hm there may be something weird on our end then, not sure I haven’t been able to replicate this.

    once the tui rewrite is done some key captures may perform better so I hope this will be addressed by the rewrite

  9. rekram1-node commented on Sep 27, 2025

    @rekram1-node
    Contributor

    For now I am going to close as duplicate of #1505

    what keybind did you try to remap it to?

  10. epicwhale commented on Sep 27, 2025

    @epicwhale
    Author

    @rekram1-node here's what I tried in ~/.config/opencode/opencode.json

    Image

    did I get something wrong?

  11. epicwhale commented on Sep 27, 2025

    @epicwhale
    Author

    @rekram1-node okay so oddly with the keybind above, ctrl+enter works in Ghostty (but shift+enter does not), and neither of the two keybinds work in VS Code terminal.

  12. rekram1-node commented on Sep 27, 2025

    @rekram1-node
    Contributor

    weird, so the vscode one doesn’t surprise me because their app will try to capture some of the bindings

    once the migration is complete I think we can address these better, rn it is an annoying issue so I apologize

  13. epicwhale commented on Sep 28, 2025

    @epicwhale
    Author

    weird, so the vscode one doesn’t surprise me because their app will try to capture some of the bindings

    once the migration is complete I think we can address these better, rn it is an annoying issue so I apologize

    Thanks for the replies and trying to troubleshoot! May I ask out of curiosity when is this TUI migration expected? Looks like a major overhaul!

  14. rekram1-node commented on Sep 28, 2025

    @rekram1-node
    Contributor

    I am thinking it should be done within a week or two but I can’t say for sure, you can track progress here: #2685

  15. 11 remaining items

  16. thunderkid commented on Jan 27, 2026

    @thunderkid

    alt+enter works in linux/kde/alacritty. other suggestions don't.

  17. gitTerebi commented on Jan 27, 2026

    @gitTerebi

    alt+enter worked for me too in webstorm using the opencode plugin.

  18. Koleok commented on Feb 2, 2026

    @Koleok

    alt(opt)+enter working on mac/ghostty/tmux. Would loooove vim keybinds in this input.

  19. darkBuddha commented on Feb 4, 2026

    @darkBuddha

    Guys. How can this not be fixed (macOS)

  20. LeonardoBerlatto commented on Feb 5, 2026

    @LeonardoBerlatto

    Running it in warp and Ctrl+J works.

    Can we please fix to shift enter to work? 🙏

  21. ajihsan commented on Feb 6, 2026

    @ajihsan

    Guys. How can this not be fixed (macOS)

    Using Option + Return works for me on Mac.

  22. joaobibiano commented on Feb 20, 2026

    @joaobibiano

    For anyone hitting this on Alacritty, adding this to your ~/.config/alacritty/alacritty.toml fixes it:

    [[keyboard.bindings]]
    key = "Return"
    mods = "Shift"
    chars = "\u001b[13;2u"
    

    This forces Alacritty to emit the Kitty keyboard protocol sequence for Shift+Enter. Restart Alacritty after applying.

  23. AlKhrulev commented on Feb 24, 2026

    @AlKhrulev

    Guys. How can this not be fixed (macOS)

    Using Option + Return works for me on Mac.

    Can confirm, this also works for me on Mac inside tmux

  24. vaspoz commented on Mar 3, 2026

    @vaspoz

    seems the issue with Warp only - doesn't work.. Ctrl+J works, but it's not convenient

  25. fix777 commented on Mar 26, 2026

    @fix777

    For anyone encountering this issue with Ghostty on macOS, add the following to your Ghostty configuration:

    keybind = shift+enter=text:\x1b\r
    
  26. iiw commented on May 1, 2026

    @iiw

    Ctrl+J works for me too.

  27. anggaaryas commented on May 17, 2026

    @anggaaryas

    Both shift + return and opt + return doesnt work in mac default terminal.

  28. thomasccpereira commented on May 19, 2026

    @thomasccpereira

    shift + enter/ ctrl + enter/ option + enter/ cmd + enter don't work using opencode in the mac terminal.

  29. alisedighi commented on Jul 28, 2026

    @alisedighi

    ctrl+x (leader key) once. ctrl+j to add new line
    key binding

  30. bukit-kronik commented on Jul 30, 2026

    @bukit-kronik

    ctrl + shift + enter for windows

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