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

Closed
opened 2026-02-16 17:32:57 -05:00 by yindo · 30 comments
Owner

Originally created by @epicwhale on GitHub (Sep 27, 2025).

Originally assigned to: @rekram1-node on GitHub.

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
Originally created by @epicwhale on GitHub (Sep 27, 2025). Originally assigned to: @rekram1-node on GitHub. 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 ```
yindo closed this issue 2026-02-16 17:32:57 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 27, 2025):

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

  • #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.

@github-actions[bot] commented on GitHub (Sep 27, 2025): This issue might be a duplicate of existing issues. Please check: - #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.
Author
Owner

@rekram1-node commented on GitHub (Sep 27, 2025):

@epicwhale have u tried shift + enter?

that is what i use and it should be the default

@rekram1-node commented on GitHub (Sep 27, 2025): @epicwhale have u tried shift + enter? that is what i use and it should be the default
Author
Owner

@epicwhale commented on GitHub (Sep 27, 2025):

@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.

@epicwhale commented on GitHub (Sep 27, 2025): > @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.
Author
Owner

@epicwhale commented on GitHub (Sep 27, 2025):

@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: https://github.com/sst/opencode/issues/1505#issuecomment-3322134644

@epicwhale commented on GitHub (Sep 27, 2025): > > [@epicwhale](https://github.com/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: https://github.com/sst/opencode/issues/1505#issuecomment-3322134644
Author
Owner

@rekram1-node commented on GitHub (Sep 27, 2025):

@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
@rekram1-node commented on GitHub (Sep 27, 2025): @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
Author
Owner

@epicwhale commented on GitHub (Sep 27, 2025):

@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
@epicwhale commented on GitHub (Sep 27, 2025): @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 > >
Author
Owner

@rekram1-node commented on GitHub (Sep 27, 2025):

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

@rekram1-node commented on GitHub (Sep 27, 2025): 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
Author
Owner

@rekram1-node commented on GitHub (Sep 27, 2025):

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

what keybind did you try to remap it to?

@rekram1-node commented on GitHub (Sep 27, 2025): For now I am going to close as duplicate of #1505 what keybind did you try to remap it to?
Author
Owner

@epicwhale commented on GitHub (Sep 27, 2025):

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

Image

did I get something wrong?

@epicwhale commented on GitHub (Sep 27, 2025): @rekram1-node here's what I tried in ~/.config/opencode/opencode.json <img width="394" height="106" alt="Image" src="https://github.com/user-attachments/assets/9a262c79-3bbf-473f-8882-e50c77ab3713" /> did I get something wrong?
Author
Owner

@epicwhale commented on GitHub (Sep 27, 2025):

@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.

@epicwhale commented on GitHub (Sep 27, 2025): @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.
Author
Owner

@rekram1-node commented on GitHub (Sep 27, 2025):

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

@rekram1-node commented on GitHub (Sep 27, 2025): 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
Author
Owner

@epicwhale commented on GitHub (Sep 28, 2025):

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!

@epicwhale commented on GitHub (Sep 28, 2025): > 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!
Author
Owner

@rekram1-node commented on GitHub (Sep 28, 2025):

I am thinking it should be done within a week or two but I can’t say for sure, you can track progress here: https://github.com/sst/opencode/pull/2685

@rekram1-node commented on GitHub (Sep 28, 2025): I am thinking it should be done within a week or two but I can’t say for sure, you can track progress here: https://github.com/sst/opencode/pull/2685
Author
Owner

@fkukuck commented on GitHub (Sep 29, 2025):

@epicwhale Try \ then Enter

@fkukuck commented on GitHub (Sep 29, 2025): @epicwhale Try `\` then Enter
Author
Owner

@epicwhale commented on GitHub (Sep 29, 2025):

@epicwhale Try \ then Enter

this works!!

@epicwhale commented on GitHub (Sep 29, 2025): > [@epicwhale](https://github.com/epicwhale) Try `\` then Enter this works!!
Author
Owner

@philharmonie commented on GitHub (Jan 15, 2026):

\ then enter is even submitting the prompt on MacOS using Warp Terminal

@philharmonie commented on GitHub (Jan 15, 2026): \ then enter is even submitting the prompt on MacOS using Warp Terminal
Author
Owner

@Flagrare commented on GitHub (Jan 15, 2026):

\ then enter is even submitting the prompt on MacOS using Warp Terminal

Exactly this

@Flagrare commented on GitHub (Jan 15, 2026): > \ then enter is even submitting the prompt on MacOS using Warp Terminal Exactly this
Author
Owner

@srs-adamr commented on GitHub (Jan 15, 2026):

🙏 Yes, how do we do a new line?

@srs-adamr commented on GitHub (Jan 15, 2026): 🙏 Yes, how do we do a new line?
Author
Owner

@vinayakkulkarni commented on GitHub (Jan 16, 2026):

🙏 Yes, how do we do a new line?

Ctrl + J seems to do the trick for me on Warp terminal

@vinayakkulkarni commented on GitHub (Jan 16, 2026): > 🙏 Yes, how do we do a new line? Ctrl + J seems to do the trick for me on Warp terminal
Author
Owner

@rpajunen commented on GitHub (Jan 16, 2026):

Mac + Kitty you can use option + enter

@rpajunen commented on GitHub (Jan 16, 2026): Mac + Kitty you can use `option + enter`
Author
Owner

@bodydisplaynone commented on GitHub (Jan 23, 2026):

tried all of the above and nothing works (vscode + opencode, wsl in windows)

  • shift enter sends
  • ctrl enter sends
  • \ enter sends
  • ctrl j closes the whole terminal window (similar to ctrl ö)

any other suggestions? :)

@bodydisplaynone commented on GitHub (Jan 23, 2026): tried all of the above and nothing works (vscode + opencode, wsl in windows) - shift enter sends - ctrl enter sends - \ enter sends - ctrl j closes the whole terminal window (similar to ctrl ö) any other suggestions? :)
Author
Owner

@djfluffkins commented on GitHub (Jan 25, 2026):

@bodydisplaynone did you try opt+enter? I know the OP didn't have any luck with it. But I had the same experience as you have so I tried opt+enter anyways and it worked. Hopefully it works for you.

@djfluffkins commented on GitHub (Jan 25, 2026): @bodydisplaynone did you try opt+enter? I know the OP didn't have any luck with it. But I had the same experience as you have so I tried opt+enter anyways and it worked. Hopefully it works for you.
Author
Owner

@Enforcer-No-777 commented on GitHub (Jan 25, 2026):

Alt+Enter in VS Code terminal worked for me (Windows 11)

@Enforcer-No-777 commented on GitHub (Jan 25, 2026): Alt+Enter in VS Code terminal worked for me (Windows 11)
Author
Owner

@bodydisplaynone commented on GitHub (Jan 26, 2026):

Alt+Enter in VS Code terminal worked for me (Windows 11)

I can confirm ALT+ENTER combo working, thank you!

@bodydisplaynone commented on GitHub (Jan 26, 2026): > Alt+Enter in VS Code terminal worked for me (Windows 11) I can confirm ALT+ENTER combo working, thank you!
Author
Owner

@thunderkid commented on GitHub (Jan 26, 2026):

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

@thunderkid commented on GitHub (Jan 26, 2026): alt+enter works in linux/kde/alacritty. other suggestions don't.
Author
Owner

@gitTerebi commented on GitHub (Jan 27, 2026):

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

@gitTerebi commented on GitHub (Jan 27, 2026): alt+enter worked for me too in webstorm using the opencode plugin.
Author
Owner

@Koleok commented on GitHub (Feb 2, 2026):

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

@Koleok commented on GitHub (Feb 2, 2026): alt(opt)+enter working on mac/ghostty/tmux. Would loooove vim keybinds in this input.
Author
Owner

@darkBuddha commented on GitHub (Feb 4, 2026):

Guys. How can this not be fixed (macOS)

@darkBuddha commented on GitHub (Feb 4, 2026): Guys. How can this not be fixed (macOS)
Author
Owner

@LeonardoBerlatto commented on GitHub (Feb 5, 2026):

Running it in warp and Ctrl+J works.

Can we please fix to shift enter to work? 🙏

@LeonardoBerlatto commented on GitHub (Feb 5, 2026): Running it in warp and Ctrl+J works. Can we please fix to shift enter to work? 🙏
Author
Owner

@ajihsan commented on GitHub (Feb 6, 2026):

Guys. How can this not be fixed (macOS)

Using Option + Return works for me on Mac.

@ajihsan commented on GitHub (Feb 6, 2026): > Guys. How can this not be fixed (macOS) Using Option + Return works for me on Mac.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1857