ClawX windows path robustness (#171)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Haze <hazeone@users.noreply.github.com>
This commit is contained in:
Haze
2026-02-25 22:46:59 +08:00
committed by GitHub
Unverified
parent ade1b2ac8b
commit 9a039ab9fb
7 changed files with 256 additions and 16 deletions

View File

@@ -13,7 +13,8 @@ import {
getOpenClawDir,
getOpenClawEntryPath,
isOpenClawBuilt,
isOpenClawPresent
isOpenClawPresent,
quoteForCmd,
} from '../utils/paths';
import { getSetting } from '../utils/store';
import { getApiKey, getDefaultProvider, getProvider } from '../utils/secure-storage';
@@ -755,11 +756,15 @@ export class GatewayManager extends EventEmitter {
}
}
this.process = spawn(command, args, {
const useShell = !app.isPackaged && process.platform === 'win32';
const spawnCmd = useShell ? quoteForCmd(command) : command;
const spawnArgs = useShell ? args.map(a => quoteForCmd(a)) : args;
this.process = spawn(spawnCmd, spawnArgs, {
cwd: openclawDir,
stdio: ['ignore', 'pipe', 'pipe'],
detached: false,
shell: !app.isPackaged && process.platform === 'win32', // shell only in dev on Windows
shell: useShell,
env: spawnEnv,
});
const child = this.process;