Skip to content

TUI "Copy to clipboard" reports success but does not update Windows clipboard under WSL #39359

Description

@Jackson98Tomphson

Description

When running OpenCode inside WSL, selecting text in the TUI and choosing "Copy to clipboard" shows the success notification, but nothing is actually copied to the Windows clipboard.

I verified that the issue is not related to OSC52 support, Windows Terminal, WSL clipboard integration, or tmux.

Plugins

{ "plugin": [ "opencode-vibeguard", "opencode-notify" ] }

OpenCode version

1.18.8

Steps to reproduce

Environment

Windows Terminal
└── WSL (Ubuntu)
    └── zsh
        └── OpenCode

Reproduction

  1. Start OpenCode from a WSL shell.
  2. Open any chat session.
  3. Highlight part of a message.
  4. Select Copy to clipboard from the popup menu.
  5. Open a Windows application (Notepad, VS Code, etc.).
  6. Press Ctrl+V.

Expected behavior

The selected text should be copied to the Windows clipboard and pasted successfully.

Actual behavior

OpenCode displays a "Copy to clipboard" success notification,
but the Windows clipboard is not updated and nothing can be pasted.

Debugging performed

The issue occurs both:

  • inside tmux
  • outside tmux

Outside tmux:

echo $TERM
xterm-256color

echo $TMUX

Output:

(empty)

I also verified that OSC52 clipboard integration works correctly from the same WSL environment:

printf '\033]52;c;%s\a' "$(printf 'OSC52_TEST' | base64 -w0)"

After running the command above, I can successfully paste:

OSC52_TEST

into Windows applications.

This suggests that:

  • Windows clipboard integration is working
  • Windows Terminal supports OSC52
  • WSL clipboard access is working
  • the problem is not caused by tmux
  • the issue appears to be specific to OpenCode's clipboard handling

Screenshot and/or share link

No response

Operating System

Windows 11 WSL Ubuntu

Terminal

Windows Terminal

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