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

Open
opened 2026-02-16 18:06:18 -05:00 by yindo · 2 comments
Owner

Originally created by @zhengpenghou on GitHub (Jan 21, 2026).

Originally assigned to: @kommander on GitHub.

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

Originally created by @zhengpenghou on GitHub (Jan 21, 2026). Originally assigned to: @kommander on GitHub. ### 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_
yindo added the opentuibug labels 2026-02-16 18:06:18 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 21, 2026):

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

  • #9922: Windows & Ubuntu: impossible to paste API key after /connect (Ctrl-V / Ctrl-Shift-V / right-click all fail, no hints) - Related to clipboard/paste functionality failures in terminal environments
  • #9903: Can't open TUI running on a remote Omnissa Horizon machine - Mentions Kitty terminal issues on remote machines and tmux with similar terminal rendering problems

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

@github-actions[bot] commented on GitHub (Jan 21, 2026): This issue might be a duplicate of existing issues. Please check: - #9922: Windows & Ubuntu: impossible to paste API key after /connect (Ctrl-V / Ctrl-Shift-V / right-click all fail, no hints) - Related to clipboard/paste functionality failures in terminal environments - #9903: Can't open TUI running on a remote Omnissa Horizon machine - Mentions Kitty terminal issues on remote machines and tmux with similar terminal rendering problems Feel free to ignore if none of these address your specific case.
Author
Owner

@stonematt commented on GitHub (Feb 3, 2026):

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'
@stonematt commented on GitHub (Feb 3, 2026): 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. ``` bash ➜ opencode --version 1.1.49 ``` Here's my tmux.conf (nothing too special): ```text # 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' ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7145