Skip to content

shift-modified keybindings ignored inside tmux #336

Closed as not planned
Closed as not planned

Description

@camescasse

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.

Activity

  1. mohak34 commented on Jun 23, 2025

    @mohak34
    Contributor

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

  2. Axenide commented on Jul 1, 2025

    @Axenide

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

  3. Axenide commented on Jul 1, 2025

    @Axenide

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

  4. adamdotdevin commented on Jul 1, 2025

    @adamdotdevin
    Member

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

  5. dkarter commented on Jul 25, 2025

    @dkarter
    Contributor

    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

  6. dkarter commented on Jul 25, 2025

    @dkarter
    Contributor

    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 :(

  7. dkarter commented on Jul 25, 2025

    @dkarter
    Contributor

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

    Image Image
  8. mahume commented on Nov 21, 2025

    @mahume

    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.

  9. mohak34 commented on Nov 21, 2025

    @mohak34
    Contributor

    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

  10. mahume commented on Nov 24, 2025

    @mahume

    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

  11. mohak34 commented on Nov 24, 2025

    @mohak34
    Contributor

    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"

  12. added a commit that references this issue on May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions