From e7efd87ba686bec1077f866f39588ede8b0e2ddf Mon Sep 17 00:00:00 2001 From: thzxx Date: Tue, 7 Apr 2026 20:15:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E6=A0=B9=E6=8D=AE=E5=B9=B3=E5=8F=B0=E9=80=89?= =?UTF-8?q?=E6=8B=A9=20shell=EF=BC=88Windows=20=E7=94=A8=20cmd.exe?= =?UTF-8?q?=EF=BC=8C=E5=85=B6=E4=BB=96=E7=94=A8=20bash=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/workspace.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/workspace.ts b/src/main/workspace.ts index 55bd74a..3139455 100644 --- a/src/main/workspace.ts +++ b/src/main/workspace.ts @@ -86,9 +86,12 @@ export function startProcess( } try { - const proc = spawn('bash', ['-c', command], { + const isWin = process.platform === 'win32'; + const shell = isWin ? 'cmd.exe' : 'bash'; + const shellArgs = isWin ? ['/c', command] : ['-c', command]; + const proc = spawn(shell, shellArgs, { cwd: workDir, - env: { ...process.env, TERM: 'xterm-256color' }, + env: { ...process.env, ...(isWin ? {} : { TERM: 'xterm-256color' }) }, stdio: ['pipe', 'pipe', 'pipe'] });