Prevent generic Copy probing in terminal grabs - #7
Merged
Conversation
Make primary-first capture use an affine primary selection or the explicit application Copy chord directly. Keep generic Ctrl+Insert probing limited to ordinary copy profiles, and regression-protect the input policy.
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.
Why
COSMIC Terminal live qualification exposed a terminal-input safety defect: when a
primary-firstgrab could not use an affine primary selection, ClipReg injected the globalCTRL+INSERTprobe before the terminal-specificCTRL+SHIFT+Cfallback. In a terminal, that generic Insert-family probe can reach the PTY as a CSI sequence instead of acting as Copy, producing visible...~residue.This PR addresses #5 only. The unrelated clipboard-paste / primary-affinity composition problem remains tracked in #6.
What
primary-only: never inject Copy.primary-first: use affine primary when available; otherwise inject exactly the profile-defined Copy chord, with no generic probe first.copy: retain the generic safe probe and optional profile fallback behavior.primary-firstis routed through the generic probe.For COSMIC Terminal, the only injected Copy fallback is now
CTRL+SHIFT+C.Validation
Automated/local:
make checkPASS on Pop!_OS 24.04, including strict native compile, runtime lifecycle regressions, binary self-test, client/autostart tests, install rebuild planning, and sanitizers.0.2.0-beta.1+g96bd9e674a3b.CI / CheckPASS on Ubuntu 24.04.Live COSMIC Terminal:
primary_affinity=invalidproduced sevengrab-profile-copyattempts and zerograb-safe-copyattempts;ETIMEDOUTbecause nothing was selected;REGISTER ONE TEST, same metadata/timestamp), proving failed grabs do not overwrite the register;...5~,...14~, CSI residue, or SIGINT;NRestartsremained0 -> 0and post-testlist,doctor, andappremained responsive.Release impact
#5 acceptance is complete. No version bump or prerelease tag is introduced by this corrective PR. The separate #6 blocker still prevents
v0.2.0-rc.1promotion.Open / deferred