diff --git a/src/main/macos-system-sleep-assertion.test.ts b/src/main/macos-system-sleep-assertion.test.ts index de6544f2dd5..47d33f422c2 100644 --- a/src/main/macos-system-sleep-assertion.test.ts +++ b/src/main/macos-system-sleep-assertion.test.ts @@ -32,10 +32,14 @@ describe('MacosSystemSleepAssertion', () => { assertion.start('status-change') - expect(spawn).toHaveBeenCalledWith('/usr/bin/caffeinate', ['-i', '-s'], { - stdio: 'ignore', - windowsHide: true - }) + expect(spawn).toHaveBeenCalledWith( + '/usr/bin/caffeinate', + ['-i', '-s', '-w', String(process.pid)], + { + stdio: 'ignore', + windowsHide: true + } + ) }) it('is a no-op off macOS', () => { diff --git a/src/main/macos-system-sleep-assertion.ts b/src/main/macos-system-sleep-assertion.ts index 1612df813e2..36e5d521a8a 100644 --- a/src/main/macos-system-sleep-assertion.ts +++ b/src/main/macos-system-sleep-assertion.ts @@ -71,7 +71,7 @@ export class MacosSystemSleepAssertion { let child: CaffeinateProcess try { - child = this.spawn('/usr/bin/caffeinate', ['-i', '-s'], { + child = this.spawn('/usr/bin/caffeinate', ['-i', '-s', '-w', String(process.pid)], { stdio: 'ignore', windowsHide: true })