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-return does not input newline since 1.0 #4046
Default MacOS terminal does not send any modifiers for return/backspace, there is no way to capture that shift is pressed along with return. You need to use a modern terminal like Ghostty, Kitty or Alacritty.
Reacted by August Lindgren-Ruby
Reacted by Scott Baxter, Mark Van de Vyver, Jarod McBride and Andre Rabold
I figured that might be the response, but that doesn't explain why \ +enter wouldn't work or why cmd+enter (used to) work in Claude Code. I guess I'll upgrade to a big boy terminal.
There are probably some more tricks we can implement, or use native OS key events as a workaround. None of that works currently though I am afraid. I'll look some more into it.
I hope you don't mind I share some information.
This works only with the alt+enter:
"input_newline": "shift+enter,alt+enter"
I also noticed that the default cycling model only works with f2 and the reverse wouldn't with shift+f2. So far I can see cycling agents with tab and shift+tab is consistent with the default bindings. There might be something going on with handling the shift key.
Default MacOS terminal does not send any modifiers for return/backspace, there is no way to capture that shift is pressed along with return. You need to use a modern terminal like Ghostty, Kitty or Alacritty.
I'm using (linux) alacritty+zellij, and see the same behavior, c-j works but not anything else. keybindings:
The confusion is from input handling I guess. Line feed \n is usually enter, while \r is return, these are two different inputs. A keybinding like shift+linefeed would actually work, but effectively both would do the same. I'll go with the alias.
v1.0.109
The following result it the text being submitted (linux, alacritty, zellij):
Update: According to my research shift+enter actually cannot usually be detected in the terminal, so for most people the answer would be 'it can't be done in your terminal'.
Possibly though, with the rise of ai coding tui's like opencode, popular terminals like vscode's integrated terminal should add a little fairy dust to make this work.
Activity
github-actions commentedon Nov 7, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
markjaquith commentedon Nov 7, 2025
Workaround for now in Ghostty
config:anaetrezve commentedon Nov 8, 2025
In case you are facing an issue with Ghostty and Tmux, here is my workaround
kommander commentedon Nov 8, 2025
Should be fixed in the latest version
mattnico commentedon Nov 10, 2025
I have tried every version of this, ctrl+enter, cmd+enter, shift+enter, \ then enter. None of them work for me in v1.0.55
ctrl + j works but that is incredibly awkward.
I'm on mac OS using the default terminal.
kommander commentedon Nov 10, 2025
Default MacOS terminal does not send any modifiers for return/backspace, there is no way to capture that shift is pressed along with return. You need to use a modern terminal like Ghostty, Kitty or Alacritty.
mattnico commentedon Nov 11, 2025
I figured that might be the response, but that doesn't explain why \ +enter wouldn't work or why cmd+enter (used to) work in Claude Code. I guess I'll upgrade to a big boy terminal.
kommander commentedon Nov 11, 2025
There are probably some more tricks we can implement, or use native OS key events as a workaround. None of that works currently though I am afraid. I'll look some more into it.
thdxr commentedon Nov 12, 2025
how does this look on 1.0.59?
mattnico commentedon Nov 12, 2025
No change on 1.0.61
arsham commentedon Nov 12, 2025
I hope you don't mind I share some information.
This works only with the
alt+enter:I also noticed that the default cycling model only works with
f2and the reverse wouldn't withshift+f2. So far I can see cycling agents withtabandshift+tabis consistent with the default bindings. There might be something going on with handling theshiftkey.Edit: my current version is
v1.0.617 remaining items
taqtiqa-mark commentedon Nov 25, 2025
I'm using (linux) alacritty+zellij, and see the same behavior, c-j works but not anything else. keybindings:
With those bindings, leader setting works for other actions, browsing subagents/tasks:
Alacritty setting:
Zellij setting:
taqtiqa-mark commentedon Nov 25, 2025
v1.0.109
The following result it the text being submitted (linux, alacritty, zellij):
and
taqtiqa-mark commentedon Nov 25, 2025
The Alacritty workaround suggested here (#1505 (comment)), allowed me to input a newline with this keybinding:
# borked: return, enter, linefeed "input_submit": "<leader>return", # Alacritty workaround: { key = "Return", mods = "Shift", chars = "\n" } "input_newline": "shift+return",@kommander do you consider the Alacritty change a fix or a workaround?
kommander commentedon Nov 25, 2025
If the default is still
enterit's not fixed, novlabo commentedon Jan 3, 2026
I have the same issue with windows terminal.
But alacritty on windows works.
rekram1-node commentedon Jan 4, 2026
@vlabo see docs: https://opencode.ai/docs/keybinds/#shiftenter
alekscp commentedon Jan 7, 2026
Here's what worked for me on
ghostty:voltrevo commentedon Jan 16, 2026
I run into this issue frequently.
Opencode: 1.1.23
vscode integrated terminal (vscode remote ssh, host=macOS tahoe, guest=ubuntu server)
(I appreciate that workarounds may be possible but this should be fixed in opencode itself yeah?)
voltrevo commentedon Jan 16, 2026
Update: According to my research shift+enter actually cannot usually be detected in the terminal, so for most people the answer would be 'it can't be done in your terminal'.
Possibly though, with the rise of ai coding tui's like opencode, popular terminals like vscode's integrated terminal should add a little fairy dust to make this work.
crd2333 commentedon Feb 3, 2026
For anyone trying to find a solution in VSCode integrated terminal, I write this to my keybinding.json of VSCode (no modify opencode):
{ // deal with VSCode integrated terminal sending Ctrl/Shift+Enter as Enter issue "key": "shift+enter", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\n" }, // rebind shift+enter to alt+enter behavior "when": "terminalFocus" }, { "key": "ctrl+enter", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\n" }, // rebind ctrl+enter to alt+enter behavior "when": "terminalFocus" }And be sure your
terminal.integrated.sendKeybindingsToShellin VSCode settings.json is false (default value).Env:
opencode 1.1.49
Vscode integrated terminal (by vscode remote ssh, ubuntu linux as server, windows as local machine).
Now your terminal (including opencode) will be as expected —— ctrl/shift+enter as newline, and single enter as send.
wbartussek commentedon Mar 10, 2026
Still the same issue on Lubuntu 24.04 QTerminal.
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.