Repository navigation
fix(web): let focused terminal programs copy with OSC 52 - #25243
maria-rcks wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — Terminal programs can now write to the clipboard when their terminal and document are focused; clipboard reads remain disabled. Human review is required to confirm this default behavior, which allows program output to replace existing clipboard contents. You can add or adjust custom eligibility rules. Learn more. |
|
Note Written by Verified in a real dev environmentVerified unchanged head Used repository Playwright and Opened the thread terminal, ran the following through its real PTY, then pasted into the composer: printf '\033]52;c;b3NjNTIgd29ya3M=\007'
Blacksmith checks on this head: all 47 surface/core tests passed. Before, main: After, PR: Inspected the full-size screenshots and exported recording. Verified uploaded image bytes and video playback and seeking, including T3's browser player. Not verifiedNative iOS/Android, Electron, macOS/Windows, Safari/Firefox, remote/relay/tunnel connections, tmux/Vim passthrough, large clipboard payloads, clipboard-permission rejection, and browser-window focus loss were not exercised here. This pass verifies Linux Chrome's local web thread-terminal path. Malformed payloads and clipboard read suppression passed the existing automated tests; they were not separately driven through the real PTY in this pass. |
Co-authored-by: maria <254055478+maria-rcks@users.noreply.github.com>
d786361 to
1eb74fc
Compare



Problem
Terminal programs emit OSC 52 to copy text, but the web terminal ignores it and leaves the old clipboard contents unchanged.
Change
Retain the original's bounded streaming scanner and wire clipboard writes into the thread terminal. Only focused, visible terminals in a focused browser window can copy; history replay resets the scanner without copying, and clipboard reads are never answered. Clipboard failures use the existing error toast. Four files, no dependencies or new test files.
Verification
3de45c6254) before implementation. All 47 surface/core tests pass after it.vp run check:changedpasses format, lint, both dependency checks, affected typechecks, and all 34 adjacent tests.vp run dev, real PTY and clipboard: the same command pastesold clipboardon main andosc52 worksafter the fix. Unfocused live output and reload history preserve a sentinel clipboard.1eb74fcdf3, rebased on main.Takeover
Replaces #25051, with thanks to @maria-rcks for the original implementation.
Built with GPT-6.1-Sol in the Codex harness on T3 Code.