From e176f6db14941c686fdb40f359b1dd039e8b28c2 Mon Sep 17 00:00:00 2001 From: Memory <134070804+Memory2314@users.noreply.github.com> Date: Sun, 17 Aug 2025 13:38:49 +0800 Subject: [PATCH] fix: selection loss in light mode --- src/main/core/manager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/core/manager.ts b/src/main/core/manager.ts index f9cca08..e062bf0 100644 --- a/src/main/core/manager.ts +++ b/src/main/core/manager.ts @@ -113,7 +113,7 @@ export async function startCore(detached = false): Promise[]> { corePath, ['-d', diffWorkDir ? mihomoProfileWorkDir(current) : mihomoWorkDir(), ctlParam, mihomoIpcPath], { - detached: detached, + detached: true, stdio: detached ? 'ignore' : undefined, env: env } @@ -218,7 +218,7 @@ export async function restartCore(): Promise { export async function keepCoreAlive(): Promise { try { - await startCore(true) + if (!child) await startCore(true) if (child && child.pid) { await writeFile(path.join(dataDir(), 'core.pid'), child.pid.toString()) }