From af4dc0722b641fbf1a796a8f4db8ed80e6fb3917 Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Wed, 11 Feb 2026 22:56:41 +0900 Subject: [PATCH] =?UTF-8?q?takt=20run=20=E5=AE=9F=E8=A1=8C=E6=99=82?= =?UTF-8?q?=E3=81=AB=E8=93=8B=E9=96=89=E3=81=98=E3=82=B9=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=83=97=E3=82=92=E6=8A=91=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/__tests__/sleep.test.ts | 2 +- src/shared/utils/sleep.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/__tests__/sleep.test.ts b/src/__tests__/sleep.test.ts index cafb307..7f099d1 100644 --- a/src/__tests__/sleep.test.ts +++ b/src/__tests__/sleep.test.ts @@ -71,7 +71,7 @@ describe('preventSleep', () => { expect(spawn).toHaveBeenCalledWith( '/usr/bin/caffeinate', - ['-di', '-w', String(process.pid)], + ['-dis', '-w', String(process.pid)], { stdio: 'ignore', detached: true } ); expect(mockChild.unref).toHaveBeenCalled(); diff --git a/src/shared/utils/sleep.ts b/src/shared/utils/sleep.ts index 5e8164c..f2cdc55 100644 --- a/src/shared/utils/sleep.ts +++ b/src/shared/utils/sleep.ts @@ -8,10 +8,10 @@ const log = createLogger('sleep'); let caffeinateStarted = false; /** - * takt実行中のmacOSアイドルスリープおよびディスプレイスリープを防止する。 + * takt実行中のmacOSスリープを防止する。 * -d: ディスプレイスリープ防止(App Nap によるプロセス凍結を回避) * -i: アイドルスリープ防止 - * 蓋を閉じた場合のスリープは防げない(-s はAC電源が必要なため)。 + * -s: システムスリープ防止(AC電源接続時のみ有効、蓋閉じでも動作継続) */ export function preventSleep(): void { if (caffeinateStarted) { @@ -28,7 +28,7 @@ export function preventSleep(): void { return; } - const child = spawn(caffeinatePath, ['-di', '-w', String(process.pid)], { + const child = spawn(caffeinatePath, ['-dis', '-w', String(process.pid)], { stdio: 'ignore', detached: true, });