From f1575f6d8de2f4efa0805a2d11a4a421a1a8228f Mon Sep 17 00:00:00 2001 From: Gal Zahavi <38544478+galz10@users.noreply.github.com> Date: Tue, 19 Aug 2025 16:03:51 -0700 Subject: feat(core): refactor shell execution to use node-pty (#6491) Co-authored-by: Jacob Richman --- packages/cli/src/ui/hooks/shellCommandProcessor.test.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'packages/cli/src/ui/hooks/shellCommandProcessor.test.ts') diff --git a/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts b/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts index d5270aba..9c13c8ec 100644 --- a/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts +++ b/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts @@ -65,7 +65,10 @@ describe('useShellCommandProcessor', () => { setPendingHistoryItemMock = vi.fn(); onExecMock = vi.fn(); onDebugMessageMock = vi.fn(); - mockConfig = { getTargetDir: () => '/test/dir' } as Config; + mockConfig = { + getTargetDir: () => '/test/dir', + getShouldUseNodePtyShell: () => false, + } as Config; mockGeminiClient = { addHistory: vi.fn() } as unknown as GeminiClient; vi.mocked(os.platform).mockReturnValue('linux'); @@ -104,13 +107,12 @@ describe('useShellCommandProcessor', () => { ): ShellExecutionResult => ({ rawOutput: Buffer.from(overrides.output || ''), output: 'Success', - stdout: 'Success', - stderr: '', exitCode: 0, signal: null, error: null, aborted: false, pid: 12345, + executionMethod: 'child_process', ...overrides, }); @@ -141,6 +143,7 @@ describe('useShellCommandProcessor', () => { '/test/dir', expect.any(Function), expect.any(Object), + false, ); expect(onExecMock).toHaveBeenCalledWith(expect.any(Promise)); }); @@ -223,7 +226,6 @@ describe('useShellCommandProcessor', () => { act(() => { mockShellOutputCallback({ type: 'data', - stream: 'stdout', chunk: 'hello', }); }); @@ -238,7 +240,6 @@ describe('useShellCommandProcessor', () => { act(() => { mockShellOutputCallback({ type: 'data', - stream: 'stdout', chunk: ' world', }); }); @@ -319,6 +320,7 @@ describe('useShellCommandProcessor', () => { '/test/dir', expect.any(Function), expect.any(Object), + false, ); }); -- cgit v1.2.3