mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
fix(panel): include ancestor processes in macOS relaunch pgrep/pkill
On macOS, BSD pgrep and pkill exclude ancestor processes by default unless
-a is passed. Because the detached relaunch shell is spawned from the
sidecar under Antigravity, pgrep -x and pkill -x silently missed the
running host process, causing open -a --args --remote-debugging-port=0 to
fire before the old instance exited (or while it was still running).
Use pgrep -ax and pkill -{TERM,KILL} -ax, and add a brief 0.4s pause after
process exit so LaunchServices finishes deregistering before relaunch.
This commit is contained in:
@@ -5504,9 +5504,9 @@ test('Issue #26: Antigravity Desktop 2.33.0+ automatic shortcut/launcher provisi
|
||||
assert.equal(relaunchMacRes.ok, true);
|
||||
assert.equal(macSpawnArgs.env.AGY_RELAUNCH_APP, '/Applications/Antigravity.app');
|
||||
assert.equal(macSpawnArgs.env.AGY_APP_NAME, 'Antigravity');
|
||||
assert.match(macSpawnArgs.args[1], /if osascript .* then .* fi/);
|
||||
assert.match(macSpawnArgs.args[1], /pkill -TERM -x "\$AGY_APP_NAME"/);
|
||||
assert.match(macSpawnArgs.args[1], /pkill -KILL -x "\$AGY_APP_NAME"/);
|
||||
assert.match(macSpawnArgs.args[1], /if osascript .* then .* pgrep -ax "\$AGY_APP_NAME".* fi/);
|
||||
assert.match(macSpawnArgs.args[1], /pkill -TERM -ax "\$AGY_APP_NAME"/);
|
||||
assert.match(macSpawnArgs.args[1], /pkill -KILL -ax "\$AGY_APP_NAME"/);
|
||||
assert.match(macSpawnArgs.args[1], /open -a "\$AGY_RELAUNCH_APP" --args --remote-debugging-port=0/);
|
||||
|
||||
// macOS TCC-blocked osascript falls back to ps -axo comm= and derives custom .app name
|
||||
|
||||
Reference in New Issue
Block a user