How do you insert a new line into the prompt box? (using mac + ghostty)
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
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.
@epicwhale have u tried shift + enter?
that is what i use and it should be the default
@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 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 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 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
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
For now I am going to close as duplicate of #1505
what keybind did you try to remap it to?
@rekram1-node here's what I tried in ~/.config/opencode/opencode.json
did I get something wrong?
@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.
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
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!
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
@epicwhale Try \ then Enter
\ then enter is even submitting the prompt on MacOS using Warp Terminal
\ then enter is even submitting the prompt on MacOS using Warp Terminal
Exactly this
🙏 Yes, how do we do a new line?
🙏 Yes, how do we do a new line?
Ctrl + J seems to do the trick for me on Warp terminal
Mac + Kitty you can use option + enter