You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 14d1006
Browse filesBrowse the repository at this point in the historyBrowse files
fix(macos-helper): stop the helper with SIGTERM before SIGKILL so a held mouse button is released
The helper's release handler traps SIGTERM, SIGINT and SIGHUP, but the host
stopped the helper only through `killProcessTree`, which sends SIGKILL on both
the deadline and a cancelled request. Now that the request signal reaches the
surface press, a cancelled `press --hold-ms 10000` or a dropped client killed
the helper between the mouse-down and its mouse-up and the button stayed down.
`ExecOptions` gains a `kill` policy: the first signal to send and a grace
after which SIGKILL follows. `killProcessTree` sends the policy's signal, arms
an unref'd escalation timer, and clears it on the child's exit; the group path
and the reaped-pid guard are shared by both signals. `runMacOsHelper` asks for
SIGTERM with a one-second grace on every helper run, so the release handler
runs on every stop the host applies. The helper also posts the mouse-up before
it clears the held-button record, so a signal landing between the two can no
longer exit with the button down.
Two exec tests pin the route with a trap script standing in for the helper:
a cancelled command with a kill policy sees the signal and records its release,
and a child that ignores the first signal is still ended once the grace passes.
The helper test asserts the policy the press hands the provider.
The docs note named the `desktop` surface among those that post through the
helper; that surface inspects only, and the note now says so.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
- In macOS app sessions, `screenshot` captures the target app window bounds rather than the full desktop.
325
325
- Prefer selector or `@ref`-driven interactions on macOS. Window position can shift between runs, so raw x/y point commands are less stable than snapshot-derived targets.
326
326
- Use `click --button secondary`for context menus on macOS, then run `snapshot -i` again.
327
-
- On `frontmost-app`, `desktop`, and `menubar` surfaces, `press` and `click` post synthetic mouse events through the macOS helper: `--hold-ms` is how long the button stays down (at least 40 ms, 60 ms by default, because AppKit drops a release posted in the same tick as its press), `--count` is that many independent clicks, and `--double-tap` posts each click as a double-click pair. A long schedule such as `--hold-ms 10000 --count 4` is given the time it needs, and a helper interrupted mid-hold releases the button before it exits. `--jitter-px` is not applied on these surfaces.
327
+
- On `frontmost-app`and `menubar` surfaces, `press` and `click` post synthetic mouse events through the macOS helper (the `desktop` surface inspects only): `--hold-ms` is how long the button stays down (at least 40 ms, 60 ms by default, because AppKit drops a release posted in the same tick as its press), `--count` is that many independent clicks, and `--double-tap` posts each click as a double-click pair. A long schedule such as `--hold-ms 10000 --count 4` is given the time it needs, and a helper stopped mid-hold — by a cancelled request, a dropped client, or its deadline — releases the button before it exits. `--jitter-px` is not applied on these surfaces.
328
328
- Mobile-only helpers remain unsupported on macOS: `boot`, `shutdown`, `home`, `orientation`, `app-switcher`, `action-button`, `install`, `reinstall`, `install-from-source`, and `push`.
0 commit comments