Clipboard copy fails silently in tmux when OSC 52 passthrough is disabled
Environment
- OpenCode:
v2.0.7 - OpenTUI:
0.5.10 - Windows 11 with WSL2 and WSLg
- tmux:
3.6 WAYLAND_DISPLAY=wayland-0XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir
Problem
Copying text from the OpenCode TUI did not update the Windows clipboard when running inside tmux. Copying from Neovim and tmux worked, and wl-copy/wl-paste worked correctly in the same shell.
The issue was resolved by enabling tmux passthrough:
set -g allow-passthrough onSteps to reproduce
- Run OpenCode inside tmux with: allow-passthrough off
- Copy a message or select text in the OpenCode TUI.
- Paste into another application.
- The clipboard does not contain the copied text.
- Enable allow-passthrough, reload tmux, and repeat. Copying now works.
Additional context
OpenCode uses OpenTUI with destination: "all-available", which attempts both the native host clipboard and OSC 52. OpenTUI reports the terminal route as attempted once OSC 52 has been generated and queued, even if tmux later drops it. Since wl-copy works in the same WSLg environment, it would be useful to expose or log the result of each clipboard route. Documentation for the tmux passthrough requirement, or an optional fallback to an available external clipboard provider, may also help.
Source: anomalyco/opentui