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
New line does not work with Shift+Enter or Ctrl+j #344
In the TUI, the new line keybind does not work as mentioned in the docs "input_newline": "shift+enter,ctrl+j",. Thought this might have had something to do with some clashes with terminal or tmux commands but it still does not work without tmux also. When the keybind is used, it just sends the text like the "input_submit": "enter", keybind.
versions Arch Linux 6.15.3 tmux 3.5a Ghostty 1.1.3 opencode v0.1.123
The keybind works fine for me in kitty (v0.21.2) with and without tmux (v3.4). In ghostty (v1.0.0-dev+0000000), I can insert a new line by simply pressing shift+enter with or without tmux. If I use shift+enter,ctrl+j, two newlines are inserted.
Weirdest thing, it wasn't working for me (macos, ghostty, tmux) so I added ctrl+j alongside shift+enter, and suddenly shift+enter worked as well. I'm certain opencode was on 0.1.124 the whole time despite restarting it.
Edit: I wasn't paying attention, I was detached from tmux 😅
I tried to unbind the shift+enter keybind in tmux and in ghostty and it still does not work in the tmux. I tried adding custom keybinds and no luck with tmux attached.
so interesting, both keybinds work for me on macos, ghostty, with and without tmux (haven't tried zellij but i will). anyone care to share tmux configs?
set -g mouse on
set -sg escape-time 10
setw -g prefix C-s
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
setw -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key s choose-session
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @resurrect-strategy-nvim 'session'
set -g @continuum-restore 'on'
set -g @resurrect-save 'Z'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'Nybkox/tmux-kanagawa'
unbind C-b
set -g prefix C-a
bind C-a send-prefix
set -g base-index 1
setw -g pane-base-index 1
set -g mouse on
set -g @kanagawa-plugins "time"
set -g @kanagawa-show-powerline true
set -g @kanagawa-show-left-icon session
set -g @kanagawa-time-format "%R"
set -g @kanagawa-refresh-rate 2
set -g @kanagawa-theme 'dragon'
set -g @kanagawa-ignore-window-colors true
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'
Activity
cravenceiling commentedon Jun 23, 2025
The keybind works fine for me in kitty (v0.21.2) with and without tmux (v3.4). In ghostty (v1.0.0-dev+0000000), I can insert a new line by simply pressing shift+enter with or without tmux. If I use
shift+enter,ctrl+j, two newlines are inserted.opencode version 0.1.123
adamdotdevin commentedon Jun 23, 2025
as a workaround, you can configure a custom keybind for newline
kaedendev commentedon Jun 23, 2025
Weirdest thing, it wasn't working for me (macos, ghostty, tmux) so I added ctrl+j alongside shift+enter, and suddenly shift+enter worked as well. I'm certain opencode was on 0.1.124 the whole time despite restarting it.Edit: I wasn't paying attention, I was detached from tmux 😅
benjaminwestern commentedon Jun 24, 2025
Same issue, only commenting for visibility
macos v15.5tmux v3.5aghostty v1.1.3fish v4.0.2opencode v0.1.126Pressing Shift + Enter for me simply sends the message to the model
mohak34 commentedon Jun 24, 2025
With tmux detached,
With tmux attached,
I tried to unbind the shift+enter keybind in tmux and in ghostty and it still does not work in the tmux. I tried adding custom keybinds and no luck with tmux attached.
tmux 3.5aGhostty 1.1.3opencode v0.1.123JezerM commentedon Jun 24, 2025
Same issue happens with Zellij. Outside of tmux or zellij, in a normal shell in Ghostty, the
Shift+Entercombination in open code works.zellij 0.42.2opencode 0.1.126Ghostty 1.1.3adamdotdevin commentedon Jun 24, 2025
so interesting, both keybinds work for me on macos, ghostty, with and without tmux (haven't tried zellij but i will). anyone care to share tmux configs?
mohak34 commentedon Jun 24, 2025
tmux version
tmux 3.5akaedendev commentedon Jun 24, 2025
tmux version
3.5abenjaminwestern commentedon Jun 24, 2025
camescasse commentedon Jun 25, 2025
here's mine:
greggannicott commentedon Jun 26, 2025
If it helps, I didn't have this issue until I just updated to MacOS 15.5. I was on 14.n (not sure which sorry) prior to this.
There was no update of OpenCode between it working and not working.
shift+enterfails for me when inside of tmux but works fine outside of it.Thanks.
benjaminwestern commentedon Jun 26, 2025
If it helps, gemini-cli has the same issue :)
lit-af commentedon Jun 27, 2025
shift+enterfails for me on ubuntu 22.04 inside Terminator v2.1.1 butctrl+jworks fine.robin-moser commentedon Jul 21, 2025
i fixed Shift+Enter on MacOS, Ghostty and tmux 3.5a by setting following option in my
.tmux.conf:set -g extended-keys alwaysas far as I could tell while testing, this replicates the exact behaviour I would get without running tmux.
benjaminwestern commentedon Jul 21, 2025
Confirmed! This fixed it <3 :)
mohak34 commentedon Jul 21, 2025
Yup! This fixed it. Closing this issue
Fix shift+enter while in tmux
fix: auto-start dev servers in tmux instead of blocking (anomalyco#344)
fix: update hook integration tests for auto-tmux-dev behavior
chore(aur): update PKGBUILD for 0.8.5 (anomalyco#344)