From e4d978da7ce5422cd4d2a92d369985df6387ad79 Mon Sep 17 00:00:00 2001 From: Taylor Mullen Date: Sun, 18 May 2025 01:18:32 -0700 Subject: feat(cli): Introduce toggleable shell mode with enhanced UI - Implements a toggleable shell mode, removing the need to prefix every command with `!`. - Users can now enter and exit shell mode by typing `!` as the first character in an empty input prompt. - The input prompt visually indicates active shell mode with a distinct color and `! ` prefix. - Shell command history items (`user_shell`) are now visually differentiated from regular user messages. - This provides a cleaner and more streamlined user experience for frequent shell interactions. Fixes https://b.corp.google.com/issues/418509745 --- packages/cli/src/ui/hooks/shellCommandProcessor.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages/cli/src/ui/hooks/shellCommandProcessor.ts') diff --git a/packages/cli/src/ui/hooks/shellCommandProcessor.ts b/packages/cli/src/ui/hooks/shellCommandProcessor.ts index 980a6572..543c7f24 100644 --- a/packages/cli/src/ui/hooks/shellCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/shellCommandProcessor.ts @@ -38,7 +38,10 @@ export const useShellCommandProcessor = ( const commandToExecute = rawQuery.trim().slice(1).trimStart(); const userMessageTimestamp = Date.now(); - addItemToHistory({ type: 'user', text: rawQuery }, userMessageTimestamp); + addItemToHistory( + { type: 'user_shell', text: rawQuery }, + userMessageTimestamp, + ); if (!commandToExecute) { addItemToHistory( -- cgit v1.2.3