From e83ffdd848c95073c0d9ebc6b1227685e6be1a90 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 8 Mar 2026 12:50:38 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20Windows=20=E4=B8=8B=20Claude=20=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B=E5=92=8C=20taskkill=20=E4=B8=8D=E5=86=8D=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=20CMD=20=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - spawn 改为 detached: !IS_WIN(Windows 子进程默认独立存活,无需 detached) - taskkill 增加 stdio: 'ignore' 防止弹窗 Co-Authored-By: Claude Opus 4.6 --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 936ff44..6c315b8 100644 --- a/server.js +++ b/server.js @@ -300,7 +300,7 @@ function killProcess(pid, force = false) { if (IS_WIN) { const args = ['/T', '/PID', String(pid)]; if (force) args.unshift('/F'); - spawn('taskkill', args, { windowsHide: true }); + spawn('taskkill', args, { windowsHide: true, stdio: 'ignore' }); } else { process.kill(pid, force ? 'SIGKILL' : 'SIGTERM'); } @@ -1077,7 +1077,7 @@ function handleMessage(ws, msg) { env, cwd: process.env.HOME || process.env.USERPROFILE || process.cwd(), stdio: [inputFd, outputFd, errorFd], - detached: true, + detached: !IS_WIN, windowsHide: true, }); } catch (err) {