shift-modified keybindings ignored inside tmux #239

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

Originally created by @camescasse on GitHub (Jun 23, 2025).

Originally assigned to: @adamdotdevin on GitHub.

Any keybinding that relies on shift+ is ignored when opencode is running inside a tmux pane. The same bindings work perfectly when opencode is launched outside of tmux.

OS | Arch Linux 6.15.3
tmux | 3.5a
Ghostty | 1.1.3
OpenCode | 0.1.121

This is true for both default and custom keybindings.

Originally created by @camescasse on GitHub (Jun 23, 2025). Originally assigned to: @adamdotdevin on GitHub. Any keybinding that relies on shift+<key> is ignored when opencode is running inside a tmux pane. The same bindings work perfectly when opencode is launched outside of tmux. OS | Arch Linux 6.15.3 tmux | 3.5a Ghostty | 1.1.3 OpenCode | 0.1.121 This is true for both default and custom keybindings.
yindo closed this issue 2026-02-16 17:25:53 -05:00
Author
Owner

@mohak34 commented on GitHub (Jun 23, 2025):

Shift+enter for a new line didnt work for me. Had the same doubt if something was clashing with either ghostty or tmux

@mohak34 commented on GitHub (Jun 23, 2025): Shift+enter for a new line didnt work for me. Had the same doubt if something was clashing with either ghostty or tmux
Author
Owner

@Axenide commented on GitHub (Jun 30, 2025):

Same for me. In other coding agents Alt + Enter is supported. That could be an alternative.

@Axenide commented on GitHub (Jun 30, 2025): Same for me. In other coding agents Alt + Enter is supported. That could be an alternative.
Author
Owner

@Axenide commented on GitHub (Jun 30, 2025):

Indeed, after configuring it to alt+enter it works inside tmux. :)

@Axenide commented on GitHub (Jun 30, 2025): Indeed, after configuring it to `alt+enter` it works inside `tmux`. :)
Author
Owner

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

there's more to the story, i haven't tracked this down yet, but, fwiw, shift+enter works in tmux for me

@adamdotdevin commented on GitHub (Jun 30, 2025): there's more to the story, i haven't tracked this down yet, but, fwiw, shift+enter works in tmux for me
Author
Owner

@dkarter commented on GitHub (Jul 25, 2025):

EDIT: see my other comment


I was able to get it to work by adding this to my config and reloading tmux:

set -s extended-keys on

(I use Ghostty as my emulator)

More docs are available here: https://github.com/tmux/tmux/wiki/Modifier-Keys

@dkarter commented on GitHub (Jul 25, 2025): EDIT: see my other comment --- ~I was able to get it to work by adding this to my config and reloading tmux~: ```tmux set -s extended-keys on ``` (I use Ghostty as my emulator) More docs are available here: https://github.com/tmux/tmux/wiki/Modifier-Keys
Author
Owner

@dkarter commented on GitHub (Jul 25, 2025):

I take that back - while it did fix the issue for OpenCode - this introduced another issue that prevents pasting text into neovim without all kinds of junk special characters being added :(

@dkarter commented on GitHub (Jul 25, 2025): I take that back - while it did fix the issue for OpenCode - this introduced another issue that prevents pasting text into neovim without all kinds of junk special characters being added :(
Author
Owner

@dkarter commented on GitHub (Jul 25, 2025):

Disabling this setting resolved it 🤔 maybe it's no longer needed (truecolor is working still!)

Image Image
@dkarter commented on GitHub (Jul 25, 2025): Disabling this setting resolved it 🤔 maybe it's no longer needed (truecolor is working still!) <img width="2630" height="268" alt="Image" src="https://github.com/user-attachments/assets/3c088cc5-90d4-467f-9965-d8df7fc65a1f" /> <img width="1700" height="390" alt="Image" src="https://github.com/user-attachments/assets/63a365e3-042c-47fa-a241-6d87f406c19c" />
Author
Owner

@mahume commented on GitHub (Nov 21, 2025):

Having the same issues

macOS: Version 15.7.2
tmux: stable 3.5a
Ghostty: Ghostty 1.2.3
opencode: 1.0.85

Attempted a similar fix to @dkarter by commenting out this part of my tmux config:

# set -g default-terminal "xterm-ghostty"

But no luck. Opencode with shift+enter for a newline works well outside of Tmux, just not inside of it.

@mahume commented on GitHub (Nov 21, 2025): Having the same issues macOS: Version 15.7.2 tmux: stable 3.5a Ghostty: Ghostty 1.2.3 opencode: 1.0.85 Attempted a similar fix to @dkarter by commenting out this part of my tmux config: ``` # set -g default-terminal "xterm-ghostty" ``` But no luck. Opencode with shift+enter for a newline works well outside of Tmux, just not inside of it.
Author
Owner

@mohak34 commented on GitHub (Nov 21, 2025):

EDIT: see my other comment


I was able to get it to work by adding this to my config and reloading tmux:

set -s extended-keys on

(I use Ghostty as my emulator)

More docs are available here: https://github.com/tmux/tmux/wiki/Modifier-Keys

@mahume I think you need to add this to the tmux config file and comment out the true color option. I have both of these in my config but have not faced any problem with pasting in neovim. Also the shift enter works for opencode inside tmux

@mohak34 commented on GitHub (Nov 21, 2025): > EDIT: see my other comment > > --- > ~I was able to get it to work by adding this to my config and reloading tmux~: > > ```tmux > set -s extended-keys on > ``` > > (I use Ghostty as my emulator) > > More docs are available here: https://github.com/tmux/tmux/wiki/Modifier-Keys @mahume I think you need to add this to the tmux config file and comment out the true color option. I have both of these in my config but have not faced any problem with pasting in neovim. Also the shift enter works for opencode inside tmux
Author
Owner

@mahume commented on GitHub (Nov 24, 2025):

EDIT: see my other comment

I was able to get it to work by adding this to my config and reloading tmux:
set -s extended-keys on

(I use Ghostty as my emulator)
More docs are available here: https://github.com/tmux/tmux/wiki/Modifier-Keys

@mahume I think you need to add this to the tmux config file and comment out the true color option. I have both of these in my config but have not faced any problem with pasting in neovim. Also the shift enter works for opencode inside tmux

This approach seems to result in the same issues with pasting into Neovim as described above with extra characters. I'll prob just stick with not using carriage returns in opencode. Let the LLM handle parsing that. Better than me having to parse my pasted code for hidden characters

@mahume commented on GitHub (Nov 24, 2025): > > EDIT: see my other comment > > > > ~I was able to get it to work by adding this to my config and reloading tmux~: > > set -s extended-keys on > > > > > > (I use Ghostty as my emulator) > > More docs are available here: https://github.com/tmux/tmux/wiki/Modifier-Keys > > [@mahume](https://github.com/mahume) I think you need to add this to the tmux config file and comment out the true color option. I have both of these in my config but have not faced any problem with pasting in neovim. Also the shift enter works for opencode inside tmux This approach seems to result in the same issues with pasting into Neovim as described above with extra characters. I'll prob just stick with not using carriage returns in opencode. Let the LLM handle parsing that. Better than me having to parse my pasted code for hidden characters
Author
Owner

@mohak34 commented on GitHub (Nov 24, 2025):

EDIT: see my other comment
I was able to get it to work by adding this to my config and reloading tmux:
set -s extended-keys on
(I use Ghostty as my emulator)
More docs are available here: https://github.com/tmux/tmux/wiki/Modifier-Keys

@mahume I think you need to add this to the tmux config file and comment out the true color option. I have both of these in my config but have not faced any problem with pasting in neovim. Also the shift enter works for opencode inside tmux

This approach seems to result in the same issues with pasting into Neovim as described above with extra characters. I'll prob just stick with not using carriage returns in opencode. Let the LLM handle parsing that. Better than me having to parse my pasted code for hidden characters

Is this not fixed when you comment out this line for true color support and have extended keys on in your tmux config? I do not have this issue but seems it is still caused due to some reason.

set -s extended-keys on
# set -g default-terminal "xterm-ghostty"

@mohak34 commented on GitHub (Nov 24, 2025): > > > EDIT: see my other comment > > > ~I was able to get it to work by adding this to my config and reloading tmux~: > > > set -s extended-keys on > > > (I use Ghostty as my emulator) > > > More docs are available here: https://github.com/tmux/tmux/wiki/Modifier-Keys > > > > > > [@mahume](https://github.com/mahume) I think you need to add this to the tmux config file and comment out the true color option. I have both of these in my config but have not faced any problem with pasting in neovim. Also the shift enter works for opencode inside tmux > > This approach seems to result in the same issues with pasting into Neovim as described above with extra characters. I'll prob just stick with not using carriage returns in opencode. Let the LLM handle parsing that. Better than me having to parse my pasted code for hidden characters Is this not fixed when you comment out this line for true color support and have extended keys on in your tmux config? I do not have this issue but seems it is still caused due to some reason. `set -s extended-keys on` `# set -g default-terminal "xterm-ghostty"`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#239