Repository navigation
Conversation
There was a problem hiding this comment.
The change works. I ran the reproduction from #59664 with opencode-drive in a sandbox with no host clipboard, where the terminal ignores OSC 52. On the base, a mouse-selection copy shows "Copied to clipboard"; with this change it shows the "Copied — delivery not confirmed" warning. The changed TUI tests pass (61) and tsc -b passes in packages/tui. Every toast-based caller of ClipboardService.write() handles the new return value; dialog-message.tsx shows no toast and doesn't need changes.
Public API: unchanged. ClipboardService and clipboardWriteToast are internal to the TUI.
Two points, inline: a warning on every copy over SSH even in terminals that support OSC 52, and a session-ID test that no longer pins which toast appears.
There was a problem hiding this comment.
Both earlier points are addressed. A terminal-only write now counts as copied when the terminal reports capability: "supported", so remote sessions with OSC 52 support no longer get a warning on every copy; unknown and unsupported still warn. The session-ID test now forces the terminal route with setRendererCapabilities and expects the success toast exactly. I re-ran the #59664 reproduction, where the terminal reports unknown OSC 52 support: it still shows the warning. The clipboard, session-ID and selection tests pass, and tsc -b passes. The public API is unchanged. Nothing new to raise.
There was a problem hiding this comment.
The only new commit merges dev into the branch; the pull request's own change is the same as at my last review. I checked what came in from dev: every copy toast still goes through clipboardWriteToast, and nothing in it bypasses the change. After a fresh install, the changed packages/tui tests pass (68) and tsc -b passes. The #59664 reproduction still shows the "delivery not confirmed" warning when the terminal reports unknown OSC 52 support. The public API is unchanged. Nothing new to raise.


Issue for this PR
Closes #59664
Type of change
What does this PR do?
The TUI showed "Copied to clipboard" after a mouse-selection copy even when the host clipboard write failed and the only attempted route was OSC 52. OpenTUI reports that route as
terminal.status: "attempted", which only means the escape sequence was sent; it does not confirm that the terminal copied anything, but the adapter treated that as success.ClipboardService.write()now returns"copied"only when the host clipboard confirms the write, and"attempted"when only the terminal route was tried. A smallclipboardWriteToast()helper maps"attempted"to a warning toast, "Copied — delivery not confirmed", while verified host writes keep the existing success message. The toast-based copy paths (selection, session ID, transcript, message, debug info, OAuth code, URL, path, and working-directory copy) now use that helper. Host writes still take precedence, and a write with no successful or attempted route still rejects.Using a warning instead of a hard error keeps SSH and unknown-capability terminals usable, where OSC 52 may be the only clipboard route.
How did you verify your code works?
unsupported/failedplus terminalattempted, and for host-written precedence,bun run typecheck:tscfrompackages/tui,bun run checkpassed 34/34.Checklist
Added by the opencode bot (AI-generated).
Related: #50208, #59052