fix: clipboard failure diagnosis and bounded helper execution - #894
Merged
Conversation
Keep direct AppKit extraction while separating helper launch, timeout, denial, clipboard churn, and export failures. Generic failures must not recommend Automation permission. Discard stale retry output and retain actionable paste alternatives. Keep subprocess deadlines active after pipe EOF and avoid overlapping cleanup of captured stdout. Add named-pasteboard, injected failure, runner, and headless paste regressions. Fixes #883. Fixes #891.
Inject an owned destination into the existing extraction loop so failure and cleanup tests use a private temporary directory on every platform. The live macOS path still chooses its randomized scratch filename.
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 changed
Why
A generic helper failure was treated as proof that Automation permission was missing. The existing exporter already reads AppKit directly without scripting another application, so retain that path rather than adding another helper or asking for unrelated permissions. Ctrl-V and
/pasteremain image operations; normal terminal text paste is unchanged.The subprocess fixes address failures found while testing the clipboard helper: closing output pipes bypassed the deadline, and an allocation failure could free captured output twice. Failure fixtures use private temporary directories, and native image fixtures use named pasteboards rather than the general clipboard.
Verification
scripts/eval-tier1.sh— passed, including build, unit/TUI suites, terminal probes, reachability, source-size, invariants, and SDK drift checks.zig build test -Dtest-filter=clipboard -Dtest-filter=pasteboard -Dtest-filter='#883' --summary all— passed.git diff --check— passed.3d4e852d713811464f631a3851b30f27db888c9b— Windows, Linux Zig, and SDK jobs passed.Fixes #883.
Fixes #891.