Skip to content

TUI shows "Copied to clipboard" toast even when the clipboard write fails #41928

Description

@aishangwuji

Description

In the TUI, selecting text (copy-on-select) or copying a message shows a "Copied to clipboard" toast even when nothing was actually copied — the system clipboard stays empty when pasting elsewhere.

Root cause: packages/tui/src/clipboard.ts swallows every copy error with .catch(() => undefined) in both the native command and clipboardy fallback paths, so write() always resolves and every caller shows a success toast.

Plugins

none

OpenCode version

dev

Steps to reproduce

  1. Run opencode TUI on Linux (e.g. Ubuntu, GNOME/Wayland) where wl-clipboard/xclip/xsel is not installed
  2. Drag-select some text (copy-on-select is enabled by default on Linux) or copy a message
  3. The "Copied to clipboard" toast appears
  4. Paste into another app — the clipboard is empty

Operating System

Ubuntu (GNOME/Wayland)

Terminal

GNOME 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