fix(cli): mirror paste path for transcript copy on local terminals#6560
fix(cli): mirror paste path for transcript copy on local terminals#6560andrei-kiparuk wants to merge 1 commit into
Conversation
Transcript selection copy (/copy, drag-select, Ctrl+C) only emitted OSC 52, so terminals that do not bridge OSC 52 to the OS pasteboard showed "copied to clipboard" while pbpaste stayed empty. Paste already uses atotto/clipboard; batch the same WriteAll fallback ahead of SetClipboard and keep OSC 52 for SSH/tmux setups that honor it. Co-authored-by: Cursor <cursoragent@cursor.com>
Problem: - The contributor behind #6560 helped identify and solve the CLI clipboard compatibility gap, but the integrated #6632 commit did not record that co-contribution. Root cause: - The final implementation was merged independently without a contributor trailer or a permanent acknowledgment next to the shipped fix. Fix: - Credit Andrei Kiparuk in the changelog and bilingual README acknowledgments. - Add a public Co-authored-by trailer so GitHub records the contribution after merge. Verification: - git diff --check - ./scripts/check-cache-impact.sh Co-authored-by: Andrei Kiparuk <88461327+andrei-kiparuk@users.noreply.github.com>
|
Thank you @andrei-kiparuk for identifying the OSC 52-only clipboard gap and proposing the native clipboard fallback. The hardened integration landed in #6632: local copy verifies the OS clipboard write, SSH avoids writing the remote host clipboard, and failures fall back to OSC 52 without claiming native success. Your contribution is now permanently credited by merged PR #6664 in CHANGELOG.md and both README acknowledgments. Its preserved commit also carries your public Verified on current #6560 is superseded by #6632, so I am closing this PR with credit preserved. The runtime fix is not in v1.17.15 and will ship in the next release. |
Context: - PR #6664 recorded the #6560 author as a repository co-author and also added permanent attribution text to the changelog and bilingual READMEs. Change: - Restore CHANGELOG.md, README.md, and README.zh-CN.md to their exact pre-#6664 content. - Keep the merged #6664 commit and its Co-authored-by attribution in Git history. Verification: - git diff --check - Tree comparison against the first parent of #6664 - ./scripts/check-cache-impact.sh
Summary
/copy, drag-select auto-copy, Ctrl+C on selection) only calledtea.SetClipboard(OSC 52).pbpastestayed empty.github.com/atotto/clipboard; this change batches the sameclipboard.WriteAllfallback ahead of OSC 52 so local copy matches paste behavior while SSH/tmux setups that honor OSC 52 keep working.Root cause
copyToClipboardininternal/cli/transcript.goemitted OSC 52 only.copySelectionWithNoticealways shows the success hint without verifying the pasteboard updated.Test plan
go test ./internal/cli/ -count=1/copy 1and Ctrl+C selection copy use the same pathMade with Cursor