fix(ui): disable input prompt during tool confirmation (#7935)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
Keith Lyons
2025-09-07 16:17:20 -04:00
committed by GitHub
parent 6e26c88c2c
commit 4693137b82

View File

@@ -20,7 +20,7 @@ import {
type HistoryItemWithoutId,
AuthState,
} from './types.js';
import { MessageType } from './types.js';
import { MessageType, StreamingState } from './types.js';
import {
type EditorType,
type Config,
@@ -699,7 +699,20 @@ Logging in with Google... Please restart Gemini CLI to continue.
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
const isInputActive = !initError && !isProcessing;
/**
* Determines if the input prompt should be active and accept user input.
* Input is disabled during:
* - Initialization errors
* - Slash command processing
* - Tool confirmations (WaitingForConfirmation state)
* - Any future streaming states not explicitly allowed
*/
const isInputActive =
!initError &&
!isProcessing &&
(streamingState === StreamingState.Idle ||
streamingState === StreamingState.Responding) &&
!isProQuotaDialogOpen;
// Compute available terminal height based on controls measurement
const availableTerminalHeight = useMemo(() => {