Skip to content

feat(libghostty): expose OSC 52 clipboard writes - #105

Closed
adonm wants to merge 5 commits into
elias8:mainfrom
adonm:upstream/101-osc52-source
Closed

feat(libghostty): expose OSC 52 clipboard writes#105
adonm wants to merge 5 commits into
elias8:mainfrom
adonm:upstream/101-osc52-source

Conversation

@adonm

@adonm adonm commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • expose write-only OSC 52 requests as typed libghostty and flterm callbacks on native and WASM targets
  • keep clipboard read queries disabled and leave decoding, limits, foreground checks, and clipboard access to the embedder
  • package the pinned Ghostty C/Zig patch and include patch content in deterministic source-cache keys
  • serialize source-cache publication, preserve patch line endings, refresh native outputs, and retry the Windows Zig helper race

Why

The callback is a trust boundary: libghostty reports the raw selector and base64 payload but receives no clipboard capability. Embedders retain the policy and platform effect.

The source-hook changes are included because they are what apply and reproducibly cache the packaged OSC patch; splitting them would leave this feature uncompilable. This self-contained PR replaces those portions of #101.

Verification

  • dart test test/hook/ghostty_source_test.dart: 15 passed
  • native test/impl/terminal/terminal_test.dart: 71 passed
  • flterm test/widgets/terminal_controller_test.dart: 59 passed
  • dart format --output=none --set-exit-if-changed packages/flterm packages/libghostty: clean
  • dart analyze packages/flterm: only the 3 existing info-level collection-style lints
  • CI covers native Linux/macOS/Windows, patched WASM/Chrome, generated desktop consumers, and package contents

@elias8

elias8 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Replaced by #108.

@elias8 elias8 closed this Jul 20, 2026
elias8 added a commit that referenced this pull request Jul 20, 2026
Add clipboard write handling and idle scrollback compression across
libghostty and flterm.

- Normalize OSC 52 and iTerm2 Copy writes into atomic, binary-safe
callbacks while keeping clipboard reads disabled and leaving policy and
platform access to the embedder.
- Expose incremental compression through libghostty and let flterm
schedule bounded idle work while a viewport is attached, restarting
after terminal or viewport activity and stopping on unsupported targets.

Replaces #105
@adonm
adonm deleted the upstream/101-osc52-source branch August 8, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants