Skip to content

fix(cli): mirror paste path for transcript copy on local terminals#6560

Closed
andrei-kiparuk wants to merge 1 commit into
esengine:main-v2from
andrei-kiparuk:fix/cli-copy-platform-clipboard-fallback
Closed

fix(cli): mirror paste path for transcript copy on local terminals#6560
andrei-kiparuk wants to merge 1 commit into
esengine:main-v2from
andrei-kiparuk:fix/cli-copy-platform-clipboard-fallback

Conversation

@andrei-kiparuk

Copy link
Copy Markdown
Contributor

Summary

  • Transcript copy (/copy, drag-select auto-copy, Ctrl+C on selection) only called tea.SetClipboard (OSC 52).
  • Terminals that do not bridge OSC 52 to the OS pasteboard (for example Cursor and VS Code integrated terminals on macOS) showed "copied to clipboard" while pbpaste stayed empty.
  • Paste already reads through github.com/atotto/clipboard; this change batches the same clipboard.WriteAll fallback ahead of OSC 52 so local copy matches paste behavior while SSH/tmux setups that honor OSC 52 keep working.

Root cause

copyToClipboard in internal/cli/transcript.go emitted OSC 52 only. copySelectionWithNotice always shows the success hint without verifying the pasteboard updated.

Test plan

  • go test ./internal/cli/ -count=1
  • Manual: drag-select in Reasonix TUI inside Cursor terminal, then Cmd+V confirms text is on the system pasteboard
  • /copy 1 and Ctrl+C selection copy use the same path

Made with Cursor

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>
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development tui Terminal UI / CLI (internal/cli, internal/control) labels Jul 16, 2026
SivanCola added a commit that referenced this pull request Jul 19, 2026
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>
@SivanCola

Copy link
Copy Markdown
Collaborator

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 Co-authored-by trailer, so GitHub can record you in the repository contributor graph.

Verified on current main-v2 with focused clipboard tests repeated 20 times, the full internal/cli suite, race coverage, a real Cursor integrated-terminal macOS pasteboard round trip, and deterministic local/SSH/OSC 52 routing checks.

#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.

@SivanCola SivanCola closed this Jul 19, 2026
SivanCola added a commit that referenced this pull request Jul 19, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants