fix(cli): preserve codex config args on Windows

This commit is contained in:
weishu
2026-04-26 12:05:44 +08:00
parent 010dc41369
commit 0cfc3b4ed2
6 changed files with 137 additions and 39 deletions
+11 -9
View File
@@ -4,15 +4,17 @@ import { EventEmitter } from 'node:events';
// Create a fake child process emitter for each test
let childEmitter: EventEmitter & { exitCode: number | null; killed: boolean; pid: number };
vi.mock('node:child_process', () => ({
spawn: vi.fn(() => {
childEmitter = Object.assign(new EventEmitter(), {
exitCode: null,
killed: false,
pid: 12345,
});
return childEmitter;
}),
const spawnMock = vi.hoisted(() => vi.fn(() => {
childEmitter = Object.assign(new EventEmitter(), {
exitCode: null,
killed: false,
pid: 12345,
});
return childEmitter;
}));
vi.mock('cross-spawn', () => ({
default: spawnMock
}));
vi.mock('@/ui/logger', () => ({
+2 -2
View File
@@ -1,4 +1,5 @@
import { spawn, type SpawnOptions, type StdioOptions } from 'node:child_process';
import type { SpawnOptions, StdioOptions } from 'node:child_process';
import spawn from 'cross-spawn';
import { logger } from '@/ui/logger';
import { killProcessByChildProcess } from '@/utils/process';
@@ -149,4 +150,3 @@ export async function spawnWithAbort(options: SpawnWithAbortOptions): Promise<vo
});
}