Skip to content

fix(clipboard): save images sent as text and explain stale accessibility grant - #24

Merged
Quost merged 1 commit into
mainfrom
fix/clipboard-binary-text-and-paste-permission
Nov 11, 2026
Merged

Quost merged 1 commit into
mainfrom
fix/clipboard-binary-text-and-paste-permission

Conversation

@Quost

@Quost Quost commented Nov 11, 2026

Copy link
Copy Markdown
Owner

What

1. Images from Teams/Claude stored as "âPNG" text. These apps put the PNG bytes in a text pasteboard type. Capture read .string first, and AppKit decoded the bytes as MacRoman (0x89 → â). Now:

  • BinaryClip detects text that is really a PNG/JPEG/GIF/TIFF/PDF (the 8-byte PNG signature always counts; the shorter signatures count only when control characters are present, so "GIF89a is a format" stays text), plus NUL characters and PNGs already broken by UTF-8.
  • Capture prefers NSImage(pasteboard:) in that case, falling back to rebuilding the bytes from the string.
  • When the history loads, existing bad items are converted to images (id, date, app and pin kept) or removed if they can't be recovered. On the maintainer's history, all 10 bad items decode losslessly (checked read-only).

2. Paste kept asking for Accessibility. The running copy (build/Menew.app) was ad-hoc signed, so TCC tied the grant to the binary's cdhash and every new build left Menew "on" in the list with no effect. AXIsProcessTrustedWithOptions(prompt: true) ran on every paste and showed a prompt that couldn't fix anything. Now:

  • AccessibilityGrant shows the system prompt only the first time. If Menew was trusted before, or it already prompted in this launch, it shows an alert telling the user to remove Menew from the Accessibility list and add it again, with a button that opens the settings pane. On ad-hoc builds the alert adds a sentence saying why.
  • build.sh finds .signing-identity in the main checkout when run from a git worktree (that's how the ad-hoc build happened), and warns when it falls back to ad-hoc.

New strings are translated into en/de/es/zh. CHANGELOG has a 1.102.1 entry. The only UI change is an alert, so no screenshots changed.

Tests

  • BinaryClipTests: PNG bytes read as MacRoman or Latin-1 text become an image, real text isn't treated as binary, and the stale-grant decision.
  • swift build and swift test pass (106 tests).

🤖 Generated with Claude Code

…ity grant

Teams, Claude and others put PNG bytes in a text pasteboard type, which
was stored as an "âPNG" text item. Binary text now becomes an image item,
and existing bad items are converted when the history loads.

Pasting kept showing the Accessibility prompt when Menew was on the list
but the grant belonged to another signature (ad-hoc dev builds). Menew now
prompts only the first time and otherwise explains how to re-add itself.
build.sh also finds .signing-identity from a git worktree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Quost
Quost merged commit aaeb113 into main Nov 11, 2026
11 checks passed
@Quost
Quost deleted the fix/clipboard-binary-text-and-paste-permission branch November 11, 2026 16:04
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.

1 participant