[Bug]: Copying from the terminal never works — clipboard always keeps its old content (Windows desktop, remote environment) #8361
Disclaimer: written by an AI (Claude Fable 5), reviewed and submitted by a human.
Area#
apps/desktop
Steps to reproduce#
- Windows desktop app, connected to a remote SSH environment (Ubuntu server).
- In the integrated terminal, select some text.
- Try Ctrl+C, Ctrl+Shift+C, right-click → Copy, middle-click.
- Also try a program-initiated copy (the OSC 52 escape sequence, used by tmux, vim, and many CLI tools on remote machines):
printf '\033]52;c;%s\a' "$(printf test | base64)"
Note. In regular terminal - I have a pop-up (copy or past in chat). This is fine. The error is annoying in the 'claude' terminal view.
Expected behavior#
The text lands on the Windows clipboard.
Actual behavior#
The clipboard keeps its previous content — every method, no error.
Copying a chat message works, so the clipboard itself is fine — only the terminal surface is broken.
Notes for triage#
- Selection copy: same symptom as #542 / #2275 (closed as stale) and mac twin #6173 — the #7677 fix didn't help Windows.
- OSC 52 looks unimplemented:
apps/web/src/terminal/ghostty/surface.tswrites the clipboard only from mouse selection;docs/architecture/terminal-renderers.mdcovers OSC 8 but not OSC 52.
Version or commit#
0.0.34 (latest)
Environment#
Windows 11 desktop app → remote SSH environment (Ubuntu 24.04 server)
+1 from a different client: T3 Code 1.1.0 on iPad, connected to a remote environment on a Windows 11 Home machine (10.0.26200) with the project living in WSL. Claude Code 2.1.272 running in the T3 terminal.
Two symptoms:
- Copy never lands on the iPad clipboard. Ran
/mcpin Claude Code to authenticate a new MCP server; it prints an OAuth login URL in the terminal and there is no way to get it onto the clipboard. Claude's own/copyreports success but paste still gives the previous clipboard content, same as the macOS reproduction above. - I cannot select text in the terminal at all on iPad. Long press and drag do not start a selection, so the fallback of selecting the URL by hand is not available either.
The OSC 52 gap explains the first symptom. The second might be touch-specific and separate; happy to open a dedicated issue for it if that is more useful.
- Copy never lands on the iPad clipboard. Ran
juliusmarminge added labelsneeds more info
juliusmarminge added labelsneeds-julius
Selection copying passed on current main in the Linux web client, including a separately paired remote environment: Ctrl+C, Ctrl+Shift+C, and selection-menu Copy all pasted the selected text. OSC 52 separately left the clipboard unchanged. We couldn’t verify Windows desktop or your Claude terminal session. Which Windows app version/build are you running now, and does selection copying also fail when connected to a local environment?
juliusmarminge removed labelsneeds more info
Another data point from T3 Code 0.1.7 on a remote headless Linux server, using fish 4.9.3. Our build has a local sidebar-label patch that also rewrites client asset paths; we have not compared its terminal chunk with stock 0.1.7. The remote client type was not recorded.
During the reported failure, the server terminal log contained two complete OSC 52 clipboard-write sequences with valid base64 payloads, while the client clipboard remained unchanged and no error was reported.
We have not run a minimal reproduction on stock 0.1.7 or established the cause. Bundle inspection suggested a missing OSC 52 handling path, but that remains an inference. We have not tested PR #25243 on this setup.
tanstack-source added labelsbug
Sign in to join this conversation.
Note
Triage and evidence collected, and this comment written and posted, by GPT-6 Astra in Codex on my behalf.
+1 for the OSC 52 / Claude terminal-copy part of this issue on macOS. I reproduced it in the installed desktop app, including a fresh Claude session and after fully quitting and relaunching T3. An old conversation, cancellation/resume, and fish are not required for this reproduction.
Client: T3 Code Nightly
0.0.41-nightly.20260912.1612, macOS 26.6.2, arm64. My existing remote Claude Code session was 2.1.263; a fresh session running 2.1.270 failed too.Reproduction without Claude#
Put a known marker on the client clipboard and verify it pastes. I used
CONTROL-COPY-WORKS, copied through T3's native Edit menu.Open a terminal in T3. A new terminal from the New thread screen is sufficient; no agent turn or conversation history is needed.
Run this command, which emits an OSC 52 clipboard write for
T3-OSC52-test:Paste into T3's chat composer without sending the message.
Expected:
T3-OSC52-test. Actual: the previous marker remains. No clipboard error is shown.Claude reproduction#
In a new T3 thread's terminal on the same remote Linux host, I replaced fish with a clean bash process:
I launched
claude, asked it to reply withT3-CLAUDE-COPY-PROBEwithout using tools, then ran/copy. Claude displayedCopied to clipboard (20 characters, 1 lines), but pasting into the T3 composer still insertedCONTROL-COPY-WORKS. The existing long-running Claude session gives the same result.Comparisons#
All of these tests used the same macOS desktop client:
7.0.0-31-generic, x86_64SHELL=/bin/bash, terminal modes reset with RIS (printf '\033c')7.2.2-1-cachyos, x86_64The original Claude session's
/copyalso still failed after the desktop relaunch. Directprintf T3-native-pbcopy-control | pbcopyon the local Mac worked, and pasting into T3 returned that exact value. The post-relaunch failures preserved this second control marker.Source triage#
I inspected the Ghostty integration in the installed app's source maps and compared
core.ts,runtime.ts, andsurface.tswith upstream atfcbe45796aea99e9e2a9ce19dd9409fbd7e720e4; all three matched.GhosttyTerminalCore.writepasses output toghostty_terminal_vt_write. The runtime callback wiring handles PTY replies, while the clipboard write insurface.tshandles user selection. I found no OSC 52 clipboard handler in that integration. This supports missing OSC 52 support rather than a listener expiring with session age.This confirms the OSC 52 portion of this issue; it does not establish that every keyboard/selection-copy symptom has the same cause. My earlier PR #9949 combined this with broader selection changes. These results are intended to give a narrower reproduction for triage.
The attached video is an annotated sequence of captured UI states, with terminal/composer crops combined and pauses added for readability. It demonstrates the fresh Claude failure, the bash check, and the post-relaunch failure. No repository code was changed during this investigation.
https://github.com/user-attachments/assets/cddb529b-3930-49fd-981f-b38e743b2591