diff options
| author | Allen Hutchison <[email protected]> | 2025-04-22 15:19:40 -0700 |
|---|---|---|
| committer | Allen Hutchison <[email protected]> | 2025-04-22 15:19:40 -0700 |
| commit | 8cfd9159607d9e4de82497cda118516e21582ffd (patch) | |
| tree | cda829db1333dea5d5fae2e32f06cdfb2d1c2a82 /packages/cli/src/ui/hooks/useGeminiStream.ts | |
| parent | 93458727e88cdd886af3d83198de7d8317f00507 (diff) | |
Fix the case where passthrough tools weren't using the correct CWD from -d
Diffstat (limited to 'packages/cli/src/ui/hooks/useGeminiStream.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/useGeminiStream.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts index c4d44749..27b68577 100644 --- a/packages/cli/src/ui/hooks/useGeminiStream.ts +++ b/packages/cli/src/ui/hooks/useGeminiStream.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { exec as _exec } from 'child_process'; +import { exec as _exec, exec } from 'child_process'; import { useState, useRef, useCallback, useEffect } from 'react'; import { useInput } from 'ink'; import { @@ -115,8 +115,12 @@ export const useGeminiStream = ( return; } else if (config.getPassthroughCommands().includes(maybeCommand)) { // Execute and capture output - setDebugMessage(`Executing shell command directly: ${query}`); - _exec(query, (error, stdout, stderr) => { + const targetDir = config.getTargetDir(); + setDebugMessage(`Executing shell command in ${targetDir}: ${query}`); + const execOptions = { + cwd: targetDir, + }; + _exec(query, execOptions, (error, stdout, stderr) => { const timestamp = getNextMessageId(Date.now()); if (error) { addHistoryItem( |
