shift+enter on tmux not working #108

Closed
opened 2026-02-16 17:25:13 -05:00 by yindo · 5 comments
Owner

Originally created by @albertilagan on GitHub (Jun 17, 2025).

Originally assigned to: @adamdotdevin on GitHub.

not really sure if this is a tmux or opencode issue, but when I'm on tmux hitting shift+enter sends the request instead of creating a new line.

I totally nuke my tmux config just to make sure it's related to any of my packages on tmux, didn't work

unbind C-b

set -g prefix C-a
bind C-a send-prefix

bind r source-file ~/.config/tmux/tmux.conf

set-option -g default-terminal "tmux-256color"
set-window-option -g xterm-keys on
set-option -ga terminal-overrides ",xterm-ghostty:XT"

(also have passthrough on before)

My current workaround is this

# tmux config
bind-key -n S-Enter if-shell '[ "#{pane_current_command}" = "opencode" ] || [ "#{window_name}" = "opencode" ]' \
    "send-keys M-Enter" \
    "send-keys S-Enter"
# opencode config
{
  "keybinds": {
    "input_submit": "enter",
    "input_newline": "alt+enter,ctrl+j",
Originally created by @albertilagan on GitHub (Jun 17, 2025). Originally assigned to: @adamdotdevin on GitHub. not really sure if this is a tmux or opencode issue, but when I'm on tmux hitting `shift+enter` sends the request instead of creating a new line. I totally nuke my tmux config just to make sure it's related to any of my packages on tmux, didn't work ``` unbind C-b set -g prefix C-a bind C-a send-prefix bind r source-file ~/.config/tmux/tmux.conf set-option -g default-terminal "tmux-256color" set-window-option -g xterm-keys on set-option -ga terminal-overrides ",xterm-ghostty:XT" ``` (also have passthrough on before) My current workaround is this ``` # tmux config bind-key -n S-Enter if-shell '[ "#{pane_current_command}" = "opencode" ] || [ "#{window_name}" = "opencode" ]' \ "send-keys M-Enter" \ "send-keys S-Enter" ``` ``` # opencode config { "keybinds": { "input_submit": "enter", "input_newline": "alt+enter,ctrl+j", ```
yindo closed this issue 2026-02-16 17:25:13 -05:00
Author
Owner

@adamdotdevin commented on GitHub (Jun 18, 2025):

i just overhauled keybinds completely, check the readme; you can now configure newline to a different key, lmk if that's a solution for you!

@adamdotdevin commented on GitHub (Jun 18, 2025): i just overhauled keybinds completely, check the readme; you can now configure newline to a different key, lmk if that's a solution for you!
Author
Owner

@GitMurf commented on GitHub (Jun 18, 2025):

fyi Windows Terminal + WSL2 + zsh shell + Arch Linux I also had an issue where the default shift + enter does not work (it submits the message to the LLM). But as @adamdottv mentioned, I reset the keymap to be ctrl + enter or ctrl + j (see below) and it works great! For others who may run into the same issue.

[keybinds]
leader = "ctrl+x"
input_newline = "ctrl+j,ctrl+enter"

NOTE: you see I added the leader keybind there because it appears as if you set any keybind, the leader keybind no longer is set by default so you have to explicitly add it. cc @adamdottv

@GitMurf commented on GitHub (Jun 18, 2025): fyi `Windows Terminal + WSL2 + zsh shell + Arch Linux` I also had an issue where the default `shift + enter` does not work (it submits the message to the LLM). But as @adamdottv mentioned, I reset the keymap to be `ctrl + enter` or `ctrl + j` (see below) and it works great! For others who may run into the same issue. ```toml [keybinds] leader = "ctrl+x" input_newline = "ctrl+j,ctrl+enter" ``` NOTE: you see I added the leader keybind there because it appears as if you set any keybind, the leader keybind no longer is set by default so you have to explicitly add it. cc @adamdottv
Author
Owner

@net commented on GitHub (Jun 19, 2025):

FWIW shift+enter works for me in tmux and Ghostty.

@net commented on GitHub (Jun 19, 2025): FWIW shift+enter works for me in tmux and Ghostty.
Author
Owner

@aminroosta commented on GitHub (Aug 20, 2025):

I had the same issue with tmux and ghostty, the following workaround solved it for me.

# ~/.config/ghostty/config:  map shift+enter to ctrl+e
keybind = shift+enter=text:\x05

and

# ~.config/opencode/opencode.json: map ctrl+e to input_submit
{
  "keybinds": {
    "input_submit": "ctrl+e",
    "input_newline": "shift"
@aminroosta commented on GitHub (Aug 20, 2025): I had the same issue with tmux and ghostty, the following workaround solved it for me. ```conf # ~/.config/ghostty/config: map shift+enter to ctrl+e keybind = shift+enter=text:\x05 ``` and ```py # ~.config/opencode/opencode.json: map ctrl+e to input_submit { "keybinds": { "input_submit": "ctrl+e", "input_newline": "shift" ```
Author
Owner

@princejoogie commented on GitHub (Jan 4, 2026):

for kitty users, i added this to my kitty.conf

+ map shift+enter send_text all \x1b[13;2u
@princejoogie commented on GitHub (Jan 4, 2026): for kitty users, i added this to my kitty.conf ```diff + map shift+enter send_text all \x1b[13;2u ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#108