fix: remove shell:true default to fix command output

- Removed shell:true default that caused double shell wrapping
- This was causing echo and other commands to return empty output
- Now matches OpenClaw exec behavior which never uses shell:true
This commit is contained in:
zhi
2026-03-06 09:20:38 +00:00
parent 9c70cc33a5
commit 903e5efddb
2 changed files with 72 additions and 44 deletions

View File

@@ -201,7 +201,8 @@ export async function pcexec(command: string, options: PcExecOptions = {}): Prom
const spawnOptions: SpawnOptions = {
cwd: options.cwd,
env,
shell: options.shell ?? true,
// Don't use shell by default - we're already using bash -c explicitly
shell: options.shell,
windowsHide: options.windowsHide,
uid: options.uid,
gid: options.gid,
@@ -327,7 +328,8 @@ export function pcexecSync(command: string, options: PcExecOptions = {}): PcExec
const execOptions: any = {
cwd: options.cwd,
env,
shell: options.shell ?? true,
// Don't use shell by default
shell: options.shell,
encoding: 'utf8',
windowsHide: options.windowsHide,
uid: options.uid,