Modifying `keybinds.input_newline` has no effect
Description
Putting anything into
"keybinds": {
"input_newline": "..."
},
doesn't appear to do anything. The only working keybinds for me remain Ctrl+J and Ctrl+Enter no matter what I try.
What I would like is Ctrl+Shift instead, if possible. Is it?
OpenCode version
1.0.150
Steps to reproduce
- Be on Windows Terminal
- Set
"keybinds": {
"input_newline": "Shift+Enter"
},
- Observe: Only Ctrl+J and Ctrl+Enter work.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal
This issue might be a duplicate of existing issues. Please check:
- #4997: Keybinds (pinned issue tracking keybind problems including input_newline, multiline input, and custom keybind remapping not working)
- #4046: Shift-return does not input newline since 1.0
- #4189: Line breaks do not work any more in the latest version
- #1505: shift+enter keybinding not working
- #3675: Keybind doesn't work in 1.0.7
- #4860: Cannot Load or Override Config File on macOS (also mentions input_newline set to 'none' being ignored)
For keybind-related issues, please also check our pinned keybinds documentation: #4997
Feel free to ignore if none of these address your specific case.
Duplicate, I suppose
Yes, we'll provide some scripts to tweak terminal settings across platforms and use some windows console scripting to improve, but out of the box there is currently not much I can do here I am afraid.
Slightly highjacking this issue report to notify (KDE Plasma) Konsole users suffering from the same symptom: Shift+Enter not working in OpenCode.
I found that this is because of the way Konsole is configured by default. Users of Claude Code have raised this very issue on the Claude Code issue tracker: https://github.com/anthropics/claude-code/issues/2115
TL;DR: Default key bindings for Konsole is based on Xfree 4 which binds Return+Shift to \EOM instead of to \n. When you manually modify this value in the key binding profile, then Shift+Enter does work both for Claude Code and OpenCode. Yay!