Skip to content

Copy-on-Select fails when running opencode via Tmux in Kitty terminal (Linux) #9942

Closed

Description

@geofarmbuilder

Description

When using the opencode CLI tool on a remote Linux server within a tmux session inside the Kitty terminal emulator, the "auto-copy on select" functionality fails. Highlighting text does not populate the system clipboard.

Note: This functionality works as expected in the same environment when using other CLI tools like claude-code or codex, suggesting the issue is specific to how opencode handles terminal escape sequences or clipboard integration.

Environment
Local OS: macOS

Terminal Emulator: Kitty

Remote OS: Ubuntu 24.04

Terminal Multiplexer: tmux 3.4-1ubuntu0.1

Connection: SSH

OpenCode Version:

Steps to Reproduce
Connect to a remote Linux server via SSH using the Kitty terminal.

Start a tmux session.

Launch opencode.

Select/highlight text within the opencode interface.

Attempt to paste the selection into a local application.

Expected Behavior
The selected text should be automatically copied to the system clipboard consistent with the behavior of claude-code or codex.

Actual Behavior
The text is highlighted, but the clipboard remains unchanged. No data is passed back to the local client.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 22, 2026
  2. github-actions commented on Jan 22, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. stonematt commented on Feb 3, 2026

    @stonematt

    I can confirm this is also happening in Ghostty with tmux on Mac on local files. Here's the observed behavior:

    without tmux

    1. open Ghostty -> opencode
    2. start a session, get a response
    3. highlight text -> see banner pop up that says "Copied to Clipboard"
    4. Paste - WORKS!

    with tmux

    1. open Ghostty -> start tmux -> opencode
    2. start a session, get a response
    3. highlight text -> see banner pop up that says "Copied to Clipboard"
    4. Paste - NOT THE COPIED TEXT - FAIL!

    this worked until a few days ago. This feels like a regression.

    ➜ opencode --version
    1.1.49

    Here's my tmux.conf (nothing too special):

    # Enable mouse control (clickable windows, panes, resizable panes)
    set -g mouse on
    
    # Set history limit
    set -g history-limit 50000
    
    # for neovim
    set -sg escape-time 10
    
    # Key bindings to for intuitive splits
    bind | split-window -hc "#{pane_current_path}"
    bind - split-window -vc "#{pane_current_path}"
    
    # Improve window navigation
    bind-key -n C-Left  previous-window
    bind-key -n C-Right next-window
    # Enable vim-style pane navigation
    bind-key -n C-h select-pane -L
    bind-key -n C-l select-pane -R
    bind-key -n C-j select-pane -D
    bind-key -n C-k select-pane -U
    
    # Resize panes without prefix using Ctrl+Shift+Arrow keys
    bind-key -n C-S-Up resize-pane -U 5
    bind-key -n C-S-Down resize-pane -D 5
    bind-key -n C-S-Left resize-pane -L 5
    bind-key -n C-S-Right resize-pane -R 5
    
    
    # Enable vi mode for copy mode
    setw -g mode-keys vi
    
    # Set default terminal
    set -g default-terminal "screen-256color"
    
    # status bar
    set -g status-right "#(pomo)"
    set -g status-style "fg=#665c54"
    set -g status-left-style "fg=#928374"
    
    set -g status-bg default
    set -g status-position top
    set -g status-interval 1
    set -g status-left ""
    
    # disable status
    # set -g status off
    # set -g status on
    
    # count the panes from 1
    set -g base-index 1
    setw -g pane-base-index 1
    
    # reload configuration
    bind-key -r r source-file ~/.tmux.conf
    
    # Plugin manager
    set-environment -g TMUX_PLUGIN_MANAGER_PATH ~/.tmux/plugins/
    
    # List of plugins
    set -g @plugin 'tmux-plugins/tpm'
    set -g @plugin 'tmux-plugins/tmux-sensible'
    set -g @plugin 'christoomey/vim-tmux-navigator'
    
    # Other examples:
    # set -g @plugin 'github_username/plugin_name'
    # set -g @plugin 'github_username/plugin_name#branch'
    # set -g @plugin 'git@github.com:user/plugin'
    # set -g @plugin 'git@bitbucket.com:user/plugin'
    
    # Initialize TMUX plugin manager
    run-shell '~/.tmux/plugins/tpm/tpm'
    
  4. github-actions commented on Apr 5, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  5. emsi commented on May 8, 2026

    @emsi

    No properly behaving terminal application depends on external tools for text selection and copy. On X11 no-one even needs to "copy" as selected text is immediately available for being pasted. opencode is completely broken, does not work over remote session, inside container etc. It generally is misbehaving application that damages your terminal and should be avoided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions