Skip to content

Fix clipboard dialog guard latch - #125

Merged
zackslash merged 1 commit into
mainfrom
fix/emulator-clipboard-test
Aug 23, 2026
Merged

Fix clipboard dialog guard latch#125
zackslash merged 1 commit into
mainfrom
fix/emulator-clipboard-test

Conversation

@zackslash

Copy link
Copy Markdown
Owner

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.

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.
@zackslash zackslash changed the title Fix emulator clipboard test and clipboard dialog guard latch Fix clipboard dialog guard latch Aug 23, 2026
@zackslash
zackslash merged commit bef1832 into main Aug 23, 2026
3 checks passed
@zackslash
zackslash deleted the fix/emulator-clipboard-test branch August 23, 2026 20:59
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