Fix clipboard dialog guard latch - #125
Merged
Merged
Conversation
The OSC 52 QA test failed for three script reasons: the read query was missing its data separator (ESC]52;c? instead of ESC]52;c;?), pkill -x never matches the booster-spawned app so the Allow policy never took effect before launch, and the reply capture used canonical-mode readers under busybox timeout, which get SIGTTIN as a background process group. The self-test now queries correctly, stops the app before touching the conf, and captures with a foreground read in raw mode. Also fix the clipboard read handler: the cooldown and open-dialog guards ran before the policy check, so one stuck dialog permanently blocked even Allow-policy reads. The guards now gate only the Ask path, and the dialog resets the guard on destruction, since buried dialogs are torn down without reaching DialogStatus.Inactive.
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.
Fixes the OSC 52 clipboard QA test and a related dialog-state bug.
The emulator test failed even though the app's clipboard round-trip works end to end. Three script defects stacked up: the read query was missing its data separator (ESC]52;c? instead of ESC]52;c;?), so the terminal ignored it; pkill -x never matches the booster-spawned app, so the Allow policy never took effect before launch and the running instance's cached settings dropped the key; and the reply capture ran dd/cat under busybox timeout, which reads the tty from a background process group (SIGTTIN) and always captured zero bytes. The self-test now sends a well-formed query, stops the app before touching the conf and verifies it is dead, and captures with a foreground read in raw mode. Verified passing on the emulator, with the Ask dialog still appearing and not latching after dismissal.
The clipboard read handler had the same fragility the script accidentally exposed: the cooldown and open-dialog guards ran before the policy check, so one dialog stuck open silently blocked every later read, including Allow-policy ones that never need a dialog. The guards now gate only the Ask path, and the dialog resets the guard on destruction, since a buried dialog can be torn down without passing through DialogStatus.Inactive.