[PR #8974] fix: centralize OSC 52 clipboard support for SSH sessions #12933

Closed
opened 2026-02-16 18:17:49 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8974

State: closed
Merged: Yes


Summary

  • Centralizes OSC 52 escape sequence handling in Clipboard.copy() so all clipboard operations work over SSH
  • Removes duplicate OSC 52 code from app.tsx, dialog.tsx, and session/index.tsx
  • Adds TTY check, JSDoc documentation, and GNU Screen support

Resolves #2773

Changes

File Change
clipboard.ts +16 lines: writeOsc52() with JSDoc, TTY check, tmux/screen passthrough
app.tsx -10 lines: removed duplicate OSC 52 blocks
dialog.tsx -5 lines: removed duplicate OSC 52 block
session/index.tsx -5 lines: removed duplicate OSC 52 block

Testing

Verified locally:

  • Text selection copy (local terminal)
  • Copy last message (Ctrl+X Y)
  • Copy session transcript
  • Clipboard works over SSH
  • Clipboard works in tmux
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8974 **State:** closed **Merged:** Yes --- ## Summary - Centralizes OSC 52 escape sequence handling in `Clipboard.copy()` so all clipboard operations work over SSH - Removes duplicate OSC 52 code from `app.tsx`, `dialog.tsx`, and `session/index.tsx` - Adds TTY check, JSDoc documentation, and GNU Screen support Resolves #2773 ## Changes | File | Change | |------|--------| | `clipboard.ts` | +16 lines: `writeOsc52()` with JSDoc, TTY check, tmux/screen passthrough | | `app.tsx` | -10 lines: removed duplicate OSC 52 blocks | | `dialog.tsx` | -5 lines: removed duplicate OSC 52 block | | `session/index.tsx` | -5 lines: removed duplicate OSC 52 block | ## Testing Verified locally: - ✅ Text selection copy (local terminal) - ✅ Copy last message (`Ctrl+X Y`) - ✅ Copy session transcript - ✅ Clipboard works over SSH - ✅ Clipboard works in tmux
yindo added the pull-request label 2026-02-16 18:17:49 -05:00
yindo closed this issue 2026-02-16 18:17:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12933