feat(osc52): clipboard support (remote → local, per-host opt-in) - #71
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds OSC 52 clipboard support so remote apps (tmux, vim) can write the user's local system clipboard over SSH. Write-only and gated behind a per-host opt-in that defaults off. Closes #70.
Changes
osc52_clipboard.dart— pureOsc52Clipboard.parsedecoding the OSC 52 payload: rejects read queries (?), invalid base64, and payloads over a 1 MiB cap; UTF-8 decode is malformed-tolerant; fail-soft (never throws).Host.osc52Clipboard— per-host opt-in field (default false; toJson/fromJson/copyWith; rides existing sync).SshService.dispatchPrivateOsc— routesonPrivateOSC: code52(when the host toggle is on) writes via an injectableclipboardWriter(defaults toClipboard.setData); codes7/133still go to shell integration.onPrivateOSCis now wired whenever shell integration or OSC 52 is enabled. No xterm core change.Type of change
feat— new featureHow was this tested?
cd app && flutter analyze— no new warnings (4 touched files clean)cd app && flutter test— 17 new tests (parser 7, model 4, dispatch 4, panel 2) + agent-forwarding regression + fulltest/models/(187) passprintf '\033]52;c;%s\007' "$(printf hi | base64)")Security notes
Checklist