#1516·opentui

Clipboard copy fails silently in tmux when OSC 52 passthrough is disabled

Author: NapamCreated Sep 18, 2026Updated Sep 18, 2026

Environment

  • OpenCode: v2.0.7
  • OpenTUI: 0.5.10
  • Windows 11 with WSL2 and WSLg
  • tmux: 3.6
  • WAYLAND_DISPLAY=wayland-0
  • XDG_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:

tmux
set -g allow-passthrough on

Steps to reproduce

  1. Run OpenCode inside tmux with: allow-passthrough off
  2. Copy a message or select text in the OpenCode TUI.
  3. Paste into another application.
  4. The clipboard does not contain the copied text.
  5. 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.