diff options
| author | Taylor Mullen <[email protected]> | 2025-05-19 16:11:45 -0700 |
|---|---|---|
| committer | N. Taylor Mullen <[email protected]> | 2025-05-19 16:16:47 -0700 |
| commit | 323b1298f91c7fe86f5108f8dd369b71ad81a146 (patch) | |
| tree | 874f5dc7ea98fd78672f93add3c190dfc582e1ee /packages/cli/src/ui/utils/commandUtils.ts | |
| parent | a756489f861ad58cddf67f9bfb84251d82d09169 (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/utils/commandUtils.ts')
| -rw-r--r-- | packages/cli/src/ui/utils/commandUtils.ts | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/packages/cli/src/ui/utils/commandUtils.ts b/packages/cli/src/ui/utils/commandUtils.ts index b17b264d..aadd035e 100644 --- a/packages/cli/src/ui/utils/commandUtils.ts +++ b/packages/cli/src/ui/utils/commandUtils.ts @@ -24,20 +24,3 @@ export const isAtCommand = (query: string): boolean => * @returns True if the query looks like an '/' command, false otherwise. */ export const isSlashCommand = (query: string): boolean => query.startsWith('/'); - -const control_symbols: string[] = ['/', '@', '!', '?', '$']; -/** - * Returns the first word of query with optional leading slash, ampersand, bang. - * - * @param query The input query string. - * @returns optional leading symbol and first word of query - */ -export const getCommandFromQuery = ( - query: string, -): [string | undefined, string] => { - const word = query.trim().split(/\s/, 1)[0]; - if (word.length > 0 && control_symbols.includes(word[0])) { - return [word[0], word.slice(1)]; - } - return [undefined, word]; -}; |
