diff --git a/src/main/core/manager.ts b/src/main/core/manager.ts index 7c2ca6f..72a7896 100644 --- a/src/main/core/manager.ts +++ b/src/main/core/manager.ts @@ -144,7 +144,7 @@ export async function startCore(detached = false): Promise[]> { corePath, ['-d', diffWorkDir ? mihomoProfileWorkDir(current) : mihomoWorkDir(), ctlParam, dynamicIpcPath], { - detached: true, + detached: detached, stdio: detached ? 'ignore' : undefined, env: env } @@ -378,7 +378,7 @@ export async function restartCore(): Promise { export async function keepCoreAlive(): Promise { try { - if (!child) await startCore(true) + await startCore(true) if (child && child.pid) { await writeFile(path.join(dataDir(), 'core.pid'), child.pid.toString()) }