Repository navigation
fix(clipboard): save images sent as text and explain stale accessibility grant - #24
Merged
Merged
Conversation
…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>
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.
What
1. Images from Teams/Claude stored as "âPNG" text. These apps put the PNG bytes in a text pasteboard type. Capture read
.stringfirst, and AppKit decoded the bytes as MacRoman (0x89→â). Now:BinaryClipdetects 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.NSImage(pasteboard:)in that case, falling back to rebuilding the bytes from the string.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:AccessibilityGrantshows 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.shfinds.signing-identityin 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 buildandswift testpass (106 tests).🤖 Generated with Claude Code