fix: 使用 taskkill /T 终止进程树,确保子进程也被关闭

This commit is contained in:
2026-03-20 14:13:00 +08:00
parent 8ee86c7b0f
commit 2eb5a167b3
2 changed files with 2 additions and 2 deletions

View File

@@ -170,7 +170,7 @@ class SDDService {
return new Promise((resolve) => {
log.info(`[SDDService] Stopping process ${this.processPid}...`);
exec(`taskkill /F /PID ${this.processPid}`, (error) => {
exec(`taskkill /F /T /PID ${this.processPid}`, (error) => {
this.process = null;
this.processPid = null;
this._isRunning = false;

View File

@@ -170,7 +170,7 @@ class TerminalService {
return new Promise((resolve) => {
log.info(`[TerminalService] Stopping process ${this.processPid}...`);
exec(`taskkill /F /PID ${this.processPid}`, (error) => {
exec(`taskkill /F /T /PID ${this.processPid}`, (error) => {
this.process = null;
this.processPid = null;
this._isRunning = false;