You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shift+Enter submits prompt instead of inserting newline #30544
Pressing Shift+Enter in the terminal UI prompt submits the prompt instead of inserting a newline.
The default keybindings list Shift+Return as an input newline shortcut, so this breaks multiline prompt entry for terminals that report Shift+Enter as Shift+Return.
Plugins
None
OpenCode version
dev branch
Steps to reproduce
Open the OpenCode terminal UI.
Type text into the prompt.
Press Shift+Enter.
Expected behavior
A newline is inserted into the prompt.
Actual behavior
The prompt is submitted.
Screenshot and/or share link
N/A
Operating System
Linux
Terminal
Any terminal that sends Shift+Enter as Shift+Return
This is probably happening because your terminal is actually sending a newline to opencode when you press shift+enter. Open a new terminal and run cat -v and then press shift+enter. If you see a blank line entered then your terminal is actually sending a newline to opencode and opencode never sees the shift+enter. When I do this I see ^[[27;2;13~ printed to the console.
I had the same issue and fixed it by adding this line to my .tmux.conf file: bind-key -n S-Enter send-keys Escape "[13;2u". Per the comment linked above, this is recognized as a shift+enter sequence by opencode.
Activity
github-actions commentedon Jun 3, 2026
This issue might be a duplicate of existing issues. Please check:
Shift+Returnkeybind shortcut isn't working to open a new line #16043:Shift+Returnkeybind shortcut isn't working to open a new line (open)For keybind-related issues, please also check our pinned keybinds documentation: #4997
shaoer-dev commentedon Jun 3, 2026
This is probably happening because your terminal is actually sending a newline to opencode when you press shift+enter. Open a new terminal and run
cat -vand then press shift+enter. If you see a blank line entered then your terminal is actually sending a newline to opencode and opencode never sees the shift+enter. When I do this I see^[[27;2;13~printed to the console.simonklee commentedon Jun 5, 2026
#30546 (comment)
furai commentedon Jun 18, 2026
It seems that also tmux is preventing shift+enter from being passed to opencode. In the end I'm just using ctrl+j.
shaoer-dev commentedon Jun 18, 2026
I had the same issue and fixed it by adding this line to my
.tmux.conffile:bind-key -n S-Enter send-keys Escape "[13;2u". Per the comment linked above, this is recognized as a shift+enter sequence by opencode.