Skip to content

Sync clipboard text with the host - #135

Open
alantangok wants to merge 2 commits into
NearFrame:mainfrom
alantangok:agent/clipboard-text-sync
Open

alantangok wants to merge 2 commits into
NearFrame:mainfrom
alantangok:agent/clipboard-text-sync

Conversation

@alantangok

Copy link
Copy Markdown
Contributor

Syncs clipboard text between the iOS/iPadOS client and the host, so copying on one side can be pasted on the other. No host-side install needed: the stock host already handles user data ID 7 in both directions, which I found in the macOS host.

The client polls changeCount once a second while the stream is showing, because UIPasteboard.changedNotification misses copies made in other apps. It only sends when the pasteboard has changed, so an unchanged clipboard won't overwrite the host's on reconnect. Text over 1 MiB is skipped, since the SDK warns against bulk data on this channel.

iOS 16+ shows a paste prompt unless Settings > OpenParsec > Paste from Other Apps is set to Allow. Text only, no files or images.

Works on my iPad with a macOS host, tested on my stable branch build. This branch is the same change on top of main and I've only build-checked it here. Windows hosts aren't tested.

@SandiyosDev

Copy link
Copy Markdown
Collaborator

thanks for this, clipboard sync is something people ask for, but it needs a setting, and off like default like #100, since the host can overwrite the ipad clipboard, nobody should get that without turning it on

also, please run this on a build of this branch, not only your stable one, and state what host you tested on

@alantangok
alantangok force-pushed the agent/clipboard-text-sync branch from 81b5d75 to 9dd4cb2 Compare November 15, 2026 01:49
@SandiyosDev

Copy link
Copy Markdown
Collaborator

which host did you test this on, Alan?

@alantangok

Copy link
Copy Markdown
Contributor Author

tested on a build of this branch with a macOS 26.7.3 host, clipboard sync works both ways. the setting is off by default now (9dd4cb2). haven't tested a Windows host.

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