summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useGeminiStream.ts
diff options
context:
space:
mode:
authorTaylor Mullen <[email protected]>2025-05-19 16:11:45 -0700
committerN. Taylor Mullen <[email protected]>2025-05-19 16:16:47 -0700
commit323b1298f91c7fe86f5108f8dd369b71ad81a146 (patch)
tree874f5dc7ea98fd78672f93add3c190dfc582e1ee /packages/cli/src/ui/hooks/useGeminiStream.ts
parenta756489f861ad58cddf67f9bfb84251d82d09169 (diff)
fix: Ensure user written `!` is treated opaquely if not in shell mode\n\n- Addresses an issue where commands prefixed with `!` (e.g., `!ls`) were incorrectly handled by the shell command processor if the `!` was added after initially typing the command.\n- Ensures that such commands are correctly forwarded to the Gemini model.\n- Updates `useGeminiStream` to be aware of shell mode to properly manage streaming state.\n\nFixes https://buganizer.corp.google.com/issues/418761305
Diffstat (limited to 'packages/cli/src/ui/hooks/useGeminiStream.ts')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index 29ce313d..19cb244d 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -60,6 +60,7 @@ export const useGeminiStream = (
config: Config,
onDebugMessage: (message: string) => void,
handleSlashCommand: (cmd: PartListUnion) => boolean,
+ shellModeActive: boolean,
) => {
const toolRegistry = config.getToolRegistry();
const [initError, setInitError] = useState<string | null>(null);
@@ -120,7 +121,7 @@ export const useGeminiStream = (
if (handleSlashCommand(trimmedQuery)) {
return { queryToSend: null, shouldProceed: false };
}
- if (handleShellCommand(trimmedQuery)) {
+ if (shellModeActive && handleShellCommand(trimmedQuery)) {
return { queryToSend: null, shouldProceed: false };
}
@@ -608,6 +609,7 @@ export const useGeminiStream = (
isResponding,
setShowHelp,
handleSlashCommand,
+ shellModeActive,
handleShellCommand,
config,
addItem,