You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tui: "Copied to clipboard" does not update local clipboard over SSH and tmux #50208
Active plugins: No external plugins found in inspected configuration locations
Service status: Command completed successfully and returned a local service URL
Reproduction
Open Konsole on Fedora KDE and connect to Debian over SSH.
Run OpenCode inside tmux.
Mark/select text in the OpenCode TUI. Selection alone triggers copying; no separate copy command is used.
Observe the “Copied to clipboard” notification.
Attempt to paste on the local Fedora computer.
Expected Behavior
The selected text is available in the local Fedora desktop clipboard.
Actual Behavior
OpenCode displays “Copied to clipboard”, but the local clipboard remains unchanged and pasting does not produce the selected text.
Additional Context
Confirmed comparison: Copying works when OpenCode is run over SSH without tmux. Inside tmux, the local clipboard does not update despite the success notification.
Remote tmux settings:
set-clipboard external
allow-passthrough off
The attached tmux client reports clipboard support among its terminal features. Neither DISPLAY nor WAYLAND_DISPLAY is set remotely.
OpenCode’s terminal.copy setting is not explicitly configured; V2 documentation describes copy-on-selection as the non-Windows default.
Related historical report: #19982, concerning V1.3.6. A shared root cause has not been established.
The symptom and successful test outside tmux are user-reported; remote diagnostics were collected directly. Alternative clipboard settings have not been tested.
Workaround that works over SSH + tmux:
Don't rely on TUI copy-on-selection — it can only write to the remote side and can't reach the local desktop clipboard through SSH/tmux. Instead, register a custom clipboard tool that copies content directly into the client's clipboard, plus a small skill/instruction that triggers on natural language ("copy to clipboard", "ins Clipboard") and calls clipboard({ content: "<exact text>" }).
The content then travels through the opencode client (which has access to the local clipboard) instead of the remote TUI process — bypassing the broken selection path entirely. Works fine from Fedora/Konsole → SSH → Debian → tmux.
This gets in the way of a pretty normal workflow: leave OpenCode working in tmux on a server, disconnect SSH, then reconnect and attach to the same session later. Copying says it succeeded, but the clipboard on the computer you're connecting from hasn't changed.
We also reproduced it by starting OpenCode in tmux on a Linux desktop, then attaching to that session over SSH from another computer. Clicking the working directory and choosing Copy path shows “Path copied to clipboard”, but pasting on the SSH client still gives the previous clipboard contents. The copy does reach the original computer's clipboard.
No clipboard-related tmux settings were changed. The defaults were set-clipboard external and allow-passthrough off. No external OpenCode plugins were loaded.
In a separate test with the V2 clipboard code and OpenTUI 0.5.17, the OSC 52 payload never reached the outer terminal with those tmux settings, yet the result was attempted and the copy handler reported success. That seems worth distinguishing from an actual clipboard write.
A follow-up: the terminal on the SSH client matters too. The second computer in our repro was using Ubuntu's default terminal.
I checked the actual desktop clipboard this time, rather than just checking whether the escape sequence reached the client:
GNOME Terminal 3.56.2 / VTE 0.80.1: the clipboard stays unchanged, even when sending OSC 52 directly without SSH or tmux.
kitty 0.41.1: the clipboard updates both directly and through tmux 3.5a with its default settings.
One confusing detail is that tmux advertises clipboard for both terminals, and load-buffer -w exits successfully in both cases. That isn't enough to confirm the terminal updated the clipboard.
So fixing the tmux forwarding helps with a terminal that accepts OSC 52, but won't make the GNOME Terminal case work. OpenCode should also distinguish “sent a copy request to the terminal” from a confirmed clipboard write instead of showing the same success message for both.
Same issue on opencode 2.0.29 (tmux 3.4, SSH, set-clipboard on, allow-passthrough off).
Setting the following in ~/.config/opencode/cli.json works for me:
{
"mouse": false
}
This prevents opencode from capturing mouse events, allowing tmux's native selection and copy functionality to take over. Clipboard copying then works correctly.
The downside is that all mouse interaction inside opencode is disabled.
> cat ~/.config/byobu/.tmux.conf
set -g set-clipboard on
set -g mouse on
set -g allow-passthrough on # THIS LINE added to solve for me
my access path: bare metal running Fedora Silverblue -> Gnome -> ghostty -> fish -> ssh remote -t byobu -> fish -> opencode where byobu is sort of a wrapper to tmux !
While the text below is written by Space Bunny Alpha within OpenCode, I as a person will receice github notification mails. I will try to answer your questions, as soon as possible.
Agent's analysis:
Still reproducible on 2.0.32. I traced this to the point where the write leaves OpenCode, and I think we can close the "shared root cause has not been established" question from the issue body.
Root cause confirmed at the byte level
OpenCode does not emit raw OSC 52 in a tmux pane. It emits OSC 52 wrapped in tmux DCS passthrough. I captured the pane's actual output with tmux pipe-pane -t %1 'cat >> /tmp/oc-pane.bin' while selecting repeatedly. All 10 observed writes were well-formed passthrough:
With allow-passthrough off (the tmux default), tmux discards every one of these. The writes are correct; tmux drops them at the passthrough layer. set-clipboard is irrelevant to this path — it governs raw OSC 52, not passthrough. This matches the code quoted in #25253, including the absence of a raw-OSC-52 fallback.
A test that isolates the variable
Two checks in the same pane, on the same terminal, with the same tmux config:
# A: raw OSC 52 through the pane -> reaches the local desktop clipboardprintf'\033]52;c;%s\a'"$(printf 'test-A' | base64 -w0)"# B: what OpenCode actually sends (passthrough-wrapped) -> discarded
A works and OpenCode's copy does not. That rules out the terminal, the SSH layer, and set-clipboard, and leaves passthrough as the only remaining variable.
One thing that makes this very hard to spot
fish_clipboard_copyworks in a sibling pane, which strongly suggests tmux forwarding is healthy. It isn't. fish writes raw OSC 52 straight to the client TTY and never involves tmux:
So the working neighbour and the broken TUI are not comparable, and the obvious "tmux forwards OSC 52 fine" conclusion is wrong.
Fix
set -g allow-passthrough on
One line, no OpenCode change, no restart. Mouse interaction inside the TUI keeps working, which is the main drawback of the "mouse": false workaround in the comment above.
Caveat for Ghostty users:allow-passthrough on crashes Ghostty — slowdown, cursor thrashing between text and pointer, then a crash. Reported in ghostty-org/ghostty#12551 (still open) and mentioned in #25253. I'm on Ghostty and have not hit it on 1.3.1, but it is a real risk, and it is the reason passthrough tends to be off in the first place.
On the success toast
The toast is not evidence that anything was copied. In the 2.0.32 bundle, write() resolves successfully once the terminal writer reports attempted, and attempted only means the bytes were written to the pane — not that tmux, let alone the local desktop, acted on them. Passthrough is fire-and-forget, so OpenCode cannot observe the drop, and there is no error path to surface.
Scope
This addresses the passthrough layer only. It does not address the GNOME Terminal / VTE case in the comment above, where OSC 52 does not update the clipboard even sent directly with no tmux involved — that looks like a separate terminal-capability issue.
Environment: OpenCode 2.0.32, tmux 3.4 / byobu 6.11, fish 4.9.3, outer terminal Ghostty (xterm-ghostty as reported by the tmux client), remote host Linux Mint 22.3, set-clipboard on, allow-passthrough was off, no DISPLAY/WAYLAND_DISPLAY remotely, no plugins.
Thanks for the detailed report and diagnostics. I tried to reproduce this on 2.0.11 with tmux 3.5a (set-clipboard external, allow-passthrough off, no DISPLAY or WAYLAND_DISPLAY). I used a simulated outer terminal that records everything sent to it. My simulated mouse drags never started a selection in the TUI, though, so I couldn't watch what tmux does with the clipboard write. A maintainer with a real terminal (Konsole or similar) over SSH and tmux will need to check this.
From reading the code, the TUI counts an OSC 52 clipboard write as successful once it has sent the escape sequence, whether or not anything received it. That would explain why "Copied to clipboard" shows up even when your local clipboard doesn't change. This part is tracked in #59664.
Things worth trying on your side (none of them tested here):
In tmux's documentation, set-clipboard external ignores clipboard sequences sent by programs running inside tmux. Try set -s set-clipboard on.
Thanks for following up. On my setup, set-clipboard on is already enabled, so that does not resolve the issue.
Enabling allow-passthrough on caused other keyboard shortcut issues in my setup, including an SSH disconnect when pressing Ctrl+V. I haven’t isolated the cause, so I’m keeping passthrough disabled rather than treating it as a viable workaround.
The working workaround here has been "mouse": false in OpenCode’s cli.json, allowing tmux to handle selection and copying. Copying through tmux load-buffer -w - also reaches my local clipboard.
Could OpenTUI support sending plain OSC 52 inside tmux, allowing tmux’s native set-clipboard on handling to forward it, instead of requiring DCS passthrough? This was explicitly suggested in #59134 before it was closed as a duplicate of this issue.
That would address the clipboard delivery problem without requiring allow-passthrough on or disabling mouse interaction in OpenCode. The misleading success notification tracked in #59664 is related, but fixing that alone would not restore clipboard delivery.
I opened #63578 to fix this. Inside tmux, the TUI now hands the copied text to tmux load-buffer -w -t <client>, aimed at the client showing the OpenCode pane. tmux then forwards it to that client's terminal, so it works with the default set-clipboard external and allow-passthrough off.
Tested with Kwi (libghostty) → SSH → tmux. If you can, please try the branch with your terminal and report back on the PR.
Additional data point: this also happens on direct SSH, without tmux.
I reproduced it on opencode v2.3.2 with the TUI running directly in an SSH session on a remote Linux host — no tmux/byobu, no DISPLAY/WAYLAND_DISPLAY, no ssh -X/-Y. Copying a rendered code block (and /copy) shows "Copied to clipboard", but the clipboard on the SSH client machine is unchanged. Same result from Ubuntu, Windows and macOS clients, and with fish/bash/zsh as the remote shell, so the shell is not the variable.
Note that the fix proposed in #63578 only covers the tmux branch ($TMUX set), so plain SSH sessions are still affected.
Environment
opencode: v2.3.2 (release/latest)
Remote OS: Linux x86_64 (Linux ... 7.0.0-44-generic #44~24.04.1-Ubuntu SMP ...)
Terminal: TERM=xterm-256color, COLORTERM=truecolor, TERM_PROGRAM unset (system default emulators on each client OS; exact app/version not captured)
Shell: /usr/bin/fish (also reproduced under bash/zsh)
Display: unset; no X11/Wayland forwarding
Plugins: none configured
Reproduction
On a Linux server with no display env vars, start opencode v2.3.2 in a plain SSH session (no tmux).
Ask the assistant for a code block, then use the code block's copy action (or run /copy).
OpenCode shows "Copied to clipboard".
Paste into a local editor/chat on the SSH client → the previous clipboard content is still there.
Expected
The text lands in the clipboard of the machine running the SSH client.
Actual
The toast reports success, but nothing reaches the local clipboard. Per the OpenTUI clipboard docs, a remote session uses the terminal destination for best-available, and terminal.status === "attempted" only means the OSC 52 bytes were queued — not that the outer terminal accepted them. There is no error path when the terminal ignores OSC 52, so the success toast is misleading (same false-positive path as #59664, but reachable without tmux).
Please keep the plain-SSH case in scope for the fix: either expose/configure the copy destination, or report an unconfirmed write instead of "Copied to clipboard" when only attempted is returned.
Adding three verified findings from a v1.19.6 setup (Windows Terminal → SSH → Debian 13 → tmux 3.5a → opencode TUI), since they extend the root-cause picture beyond the TUI copy path:
tmux's input_osc_52() (input.c, same in master) requires set-clipboard == 2 ("on"):
state=options_get_number(global_options, "set-clipboard");
if (state!=2)
return;
With the tmux default set-clipboard external (= 1), OSC 52 sent by applications is dropped entirely. The man page wording ("external … ignore attempts by applications to set tmux buffers") suggests forwarding to the outer terminal still happens, but it does not. Verified empirically with a PTY-capture client attached to a test server:
tmux setting
plain OSC 52 sent from pane
reaches client
external (default)
yes
no
on
yes
yes (also verified with a 10.7 KB payload)
So the "send plain OSC 52 instead of DCS passthrough" fix discussed in this thread only helps users who explicitly set set-clipboard on. Worth documenting.
2. The agent clipboard tool writes nothing at all (v1.19.6)
The built-in clipboard tool reports "Copied to clipboard (OSC 52)", but tmux pipe-pane on the pane recorded 0 bytes during the tool call. The TUI process's fd/1 points at the pane TTY, so the write goes through process.stdout – which OpenTUI takes over for rendering and swallows foreign escape sequences. Same false-success pattern as #59664, but reachable through the agent tool, not just the TUI copy path.
3. Working workaround: plugin tool bypassing process.stdout
A plugin tool that avoids process.stdout works end-to-end:
primary: write OSC 52 directly to /dev/tty (controlling terminal = pane TTY in tmux, SSH TTY otherwise)
fallback: tmux load-buffer -w (tmux then sends OSC 52 to attached clients itself)
Verified working: WT → SSH → tmux 3.5a (set-clipboard on, allow-passthrough off) → content arrives in the Windows Terminal clipboard.
Note for anyone replicating: a plugin tool named clipboard does not override the built-in tool (the built-in wins the name conflict) – use a different tool name and point the clipboard skill at it.
4. Windows Terminal focus requirement (client-side)
WT 1.25+ only applies OSC 52 clipboard writes while the pane has focus (compatibility.allowOSC52). Sequences sent while the WT window was unfocused were silently dropped in testing. Worth mentioning in docs, since it makes the failure mode look intermittent and can mislead debugging (it did here).
Activity
acaliebe commentedon Sep 20, 2026
Workaround that works over SSH + tmux:
Don't rely on TUI copy-on-selection — it can only write to the remote side and can't reach the local desktop clipboard through SSH/tmux. Instead, register a custom
clipboardtool that copies content directly into the client's clipboard, plus a small skill/instruction that triggers on natural language ("copy to clipboard", "ins Clipboard") and callsclipboard({ content: "<exact text>" }).The content then travels through the opencode client (which has access to the local clipboard) instead of the remote TUI process — bypassing the broken selection path entirely. Works fine from Fedora/Konsole → SSH → Debian → tmux.
fQwQf commentedon Oct 12, 2026
Still reproducible on 2.0.27 with tmux 3.5a.
This gets in the way of a pretty normal workflow: leave OpenCode working in tmux on a server, disconnect SSH, then reconnect and attach to the same session later. Copying says it succeeded, but the clipboard on the computer you're connecting from hasn't changed.
We also reproduced it by starting OpenCode in tmux on a Linux desktop, then attaching to that session over SSH from another computer. Clicking the working directory and choosing Copy path shows “Path copied to clipboard”, but pasting on the SSH client still gives the previous clipboard contents. The copy does reach the original computer's clipboard.
No clipboard-related tmux settings were changed. The defaults were
set-clipboard externalandallow-passthrough off. No external OpenCode plugins were loaded.In a separate test with the V2 clipboard code and OpenTUI 0.5.17, the OSC 52 payload never reached the outer terminal with those tmux settings, yet the result was
attemptedand the copy handler reported success. That seems worth distinguishing from an actual clipboard write.fQwQf commentedon Oct 12, 2026
A follow-up: the terminal on the SSH client matters too. The second computer in our repro was using Ubuntu's default terminal.
I checked the actual desktop clipboard this time, rather than just checking whether the escape sequence reached the client:
One confusing detail is that tmux advertises
clipboardfor both terminals, andload-buffer -wexits successfully in both cases. That isn't enough to confirm the terminal updated the clipboard.So fixing the tmux forwarding helps with a terminal that accepts OSC 52, but won't make the GNOME Terminal case work. OpenCode should also distinguish “sent a copy request to the terminal” from a confirmed clipboard write instead of showing the same success message for both.
kollyboi commentedon Oct 14, 2026
Same issue on opencode 2.0.29 (tmux 3.4, SSH, set-clipboard on, allow-passthrough off).
Setting the following in ~/.config/opencode/cli.json works for me:
{
"mouse": false
}
This prevents opencode from capturing mouse events, allowing tmux's native selection and copy functionality to take over. Clipboard copying then works correctly.
The downside is that all mouse interaction inside opencode is disabled.
SpiritInAShell commentedon Oct 17, 2026
TL;DR:
my access path:
bare metal running Fedora Silverblue -> Gnome -> ghostty -> fish -> ssh remote -t byobu -> fish -> opencodewherebyobuis sort of a wrapper totmux!While the text below is written by
Space Bunny Alphawithin OpenCode, I as a person will receice github notification mails. I will try to answer your questions, as soon as possible.Agent's analysis:
Still reproducible on 2.0.32. I traced this to the point where the write leaves OpenCode, and I think we can close the "shared root cause has not been established" question from the issue body.
Root cause confirmed at the byte level
OpenCode does not emit raw OSC 52 in a tmux pane. It emits OSC 52 wrapped in tmux DCS passthrough. I captured the pane's actual output with
tmux pipe-pane -t %1 'cat >> /tmp/oc-pane.bin'while selecting repeatedly. All 10 observed writes were well-formed passthrough:With
allow-passthrough off(the tmux default), tmux discards every one of these. The writes are correct; tmux drops them at the passthrough layer.set-clipboardis irrelevant to this path — it governs raw OSC 52, not passthrough. This matches the code quoted in #25253, including the absence of a raw-OSC-52 fallback.A test that isolates the variable
Two checks in the same pane, on the same terminal, with the same tmux config:
A works and OpenCode's copy does not. That rules out the terminal, the SSH layer, and
set-clipboard, and leaves passthrough as the only remaining variable.One thing that makes this very hard to spot
fish_clipboard_copyworks in a sibling pane, which strongly suggests tmux forwarding is healthy. It isn't. fish writes raw OSC 52 straight to the client TTY and never involves tmux:So the working neighbour and the broken TUI are not comparable, and the obvious "tmux forwards OSC 52 fine" conclusion is wrong.
Fix
set -g allow-passthrough onOne line, no OpenCode change, no restart. Mouse interaction inside the TUI keeps working, which is the main drawback of the
"mouse": falseworkaround in the comment above.Caveat for Ghostty users:
allow-passthrough oncrashes Ghostty — slowdown, cursor thrashing between text and pointer, then a crash. Reported in ghostty-org/ghostty#12551 (still open) and mentioned in #25253. I'm on Ghostty and have not hit it on 1.3.1, but it is a real risk, and it is the reason passthrough tends to be off in the first place.On the success toast
The toast is not evidence that anything was copied. In the 2.0.32 bundle,
write()resolves successfully once the terminal writer reportsattempted, andattemptedonly means the bytes were written to the pane — not that tmux, let alone the local desktop, acted on them. Passthrough is fire-and-forget, so OpenCode cannot observe the drop, and there is no error path to surface.Scope
This addresses the passthrough layer only. It does not address the GNOME Terminal / VTE case in the comment above, where OSC 52 does not update the clipboard even sent directly with no tmux involved — that looks like a separate terminal-capability issue.
Environment: OpenCode 2.0.32, tmux 3.4 / byobu 6.11, fish 4.9.3, outer terminal Ghostty (
xterm-ghosttyas reported by the tmux client), remote host Linux Mint 22.3,set-clipboard on,allow-passthroughwasoff, noDISPLAY/WAYLAND_DISPLAYremotely, no plugins.opencodejr commentedon Oct 28, 2026
Thanks for the detailed report and diagnostics. I tried to reproduce this on 2.0.11 with tmux 3.5a (
set-clipboard external,allow-passthrough off, noDISPLAYorWAYLAND_DISPLAY). I used a simulated outer terminal that records everything sent to it. My simulated mouse drags never started a selection in the TUI, though, so I couldn't watch what tmux does with the clipboard write. A maintainer with a real terminal (Konsole or similar) over SSH and tmux will need to check this.From reading the code, the TUI counts an OSC 52 clipboard write as successful once it has sent the escape sequence, whether or not anything received it. That would explain why "Copied to clipboard" shows up even when your local clipboard doesn't change. This part is tracked in #59664.
Things worth trying on your side (none of them tested here):
set-clipboard externalignores clipboard sequences sent by programs running inside tmux. Tryset -s set-clipboard on.set -s allow-passthrough on. This is the workaround reported in tui: clipboard copy silently fails inside tmux (OpenTUI wraps OSC 52 in DCS passthrough that tmux drops) #59134.It would help a lot to know whether either setting makes copying work for you.
Related issues:
ky-ko commentedon Oct 28, 2026
Thanks for following up. On my setup,
set-clipboard onis already enabled, so that does not resolve the issue.Enabling
allow-passthrough oncaused other keyboard shortcut issues in my setup, including an SSH disconnect when pressing Ctrl+V. I haven’t isolated the cause, so I’m keeping passthrough disabled rather than treating it as a viable workaround.The working workaround here has been
"mouse": falsein OpenCode’scli.json, allowing tmux to handle selection and copying. Copying throughtmux load-buffer -w -also reaches my local clipboard.Could OpenTUI support sending plain OSC 52 inside tmux, allowing tmux’s native
set-clipboard onhandling to forward it, instead of requiring DCS passthrough? This was explicitly suggested in #59134 before it was closed as a duplicate of this issue.That would address the clipboard delivery problem without requiring
allow-passthrough onor disabling mouse interaction in OpenCode. The misleading success notification tracked in #59664 is related, but fixing that alone would not restore clipboard delivery.Blandinium commentedon Nov 12, 2026
I opened #63578 to fix this. Inside tmux, the TUI now hands the copied text to
tmux load-buffer -w -t <client>, aimed at the client showing the OpenCode pane. tmux then forwards it to that client's terminal, so it works with the defaultset-clipboard externalandallow-passthrough off.Tested with Kwi (libghostty) → SSH → tmux. If you can, please try the branch with your terminal and report back on the PR.
noejunior299 commentedon Nov 28, 2026
Additional data point: this also happens on direct SSH, without tmux.
I reproduced it on opencode v2.3.2 with the TUI running directly in an SSH session on a remote Linux host — no tmux/byobu, no
DISPLAY/WAYLAND_DISPLAY, nossh -X/-Y. Copying a rendered code block (and/copy) shows "Copied to clipboard", but the clipboard on the SSH client machine is unchanged. Same result from Ubuntu, Windows and macOS clients, and with fish/bash/zsh as the remote shell, so the shell is not the variable.Note that the fix proposed in #63578 only covers the tmux branch (
$TMUXset), so plain SSH sessions are still affected.Environment
Linux ... 7.0.0-44-generic #44~24.04.1-Ubuntu SMP ...)TERM=xterm-256color,COLORTERM=truecolor,TERM_PROGRAMunset (system default emulators on each client OS; exact app/version not captured)/usr/bin/fish(also reproduced under bash/zsh)Reproduction
opencodev2.3.2 in a plain SSH session (no tmux)./copy).Expected
The text lands in the clipboard of the machine running the SSH client.
Actual
The toast reports success, but nothing reaches the local clipboard. Per the OpenTUI clipboard docs, a remote session uses the terminal destination for
best-available, andterminal.status === "attempted"only means the OSC 52 bytes were queued — not that the outer terminal accepted them. There is no error path when the terminal ignores OSC 52, so the success toast is misleading (same false-positive path as #59664, but reachable without tmux).Please keep the plain-SSH case in scope for the fix: either expose/configure the copy destination, or report an unconfirmed write instead of "Copied to clipboard" when only
attemptedis returned.acaliebe commentedon Nov 29, 2026
Comment draft for #50208
Adding three verified findings from a v1.19.6 setup (Windows Terminal → SSH → Debian 13 → tmux 3.5a → opencode TUI), since they extend the root-cause picture beyond the TUI copy path:
Environment
clipboardtool)6.12.113+deb13-cloud-amd641. tmux 3.5a silently drops app-sent OSC 52 unless
set-clipboard ontmux's
input_osc_52()(input.c, same in master) requiresset-clipboard == 2("on"):With the tmux default
set-clipboard external(= 1), OSC 52 sent by applications is dropped entirely. The man page wording ("external … ignore attempts by applications to set tmux buffers") suggests forwarding to the outer terminal still happens, but it does not. Verified empirically with a PTY-capture client attached to a test server:external(default)onSo the "send plain OSC 52 instead of DCS passthrough" fix discussed in this thread only helps users who explicitly set
set-clipboard on. Worth documenting.2. The agent
clipboardtool writes nothing at all (v1.19.6)The built-in
clipboardtool reports "Copied to clipboard (OSC 52)", buttmux pipe-paneon the pane recorded 0 bytes during the tool call. The TUI process's fd/1 points at the pane TTY, so the write goes throughprocess.stdout– which OpenTUI takes over for rendering and swallows foreign escape sequences. Same false-success pattern as #59664, but reachable through the agent tool, not just the TUI copy path.3. Working workaround: plugin tool bypassing process.stdout
A plugin tool that avoids
process.stdoutworks end-to-end:/dev/tty(controlling terminal = pane TTY in tmux, SSH TTY otherwise)tmux load-buffer -w(tmux then sends OSC 52 to attached clients itself)Verified working: WT → SSH → tmux 3.5a (
set-clipboard on,allow-passthrough off) → content arrives in the Windows Terminal clipboard.Note for anyone replicating: a plugin tool named
clipboarddoes not override the built-in tool (the built-in wins the name conflict) – use a different tool name and point the clipboard skill at it.4. Windows Terminal focus requirement (client-side)
WT 1.25+ only applies OSC 52 clipboard writes while the pane has focus (
compatibility.allowOSC52). Sequences sent while the WT window was unfocused were silently dropped in testing. Worth mentioning in docs, since it makes the failure mode look intermittent and can mislead debugging (it did here).