From d219f9013206aad5a1361e436ad4a45114e9cd49 Mon Sep 17 00:00:00 2001 From: Jacob Richman Date: Tue, 12 Aug 2025 14:05:49 -0700 Subject: Switch from useInput to useKeypress. (#6056) --- .../cli/src/ui/components/ShellConfirmationDialog.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'packages/cli/src/ui/components/ShellConfirmationDialog.tsx') diff --git a/packages/cli/src/ui/components/ShellConfirmationDialog.tsx b/packages/cli/src/ui/components/ShellConfirmationDialog.tsx index ec137a6d..04e57364 100644 --- a/packages/cli/src/ui/components/ShellConfirmationDialog.tsx +++ b/packages/cli/src/ui/components/ShellConfirmationDialog.tsx @@ -5,13 +5,14 @@ */ import { ToolConfirmationOutcome } from '@google/gemini-cli-core'; -import { Box, Text, useInput } from 'ink'; +import { Box, Text } from 'ink'; import React from 'react'; import { Colors } from '../colors.js'; import { RadioButtonSelect, RadioSelectItem, } from './shared/RadioButtonSelect.js'; +import { useKeypress } from '../hooks/useKeypress.js'; export interface ShellConfirmationRequest { commands: string[]; @@ -30,11 +31,14 @@ export const ShellConfirmationDialog: React.FC< > = ({ request }) => { const { commands, onConfirm } = request; - useInput((_, key) => { - if (key.escape) { - onConfirm(ToolConfirmationOutcome.Cancel); - } - }); + useKeypress( + (key) => { + if (key.name === 'escape') { + onConfirm(ToolConfirmationOutcome.Cancel); + } + }, + { isActive: true }, + ); const handleSelect = (item: ToolConfirmationOutcome) => { if (item === ToolConfirmationOutcome.Cancel) { -- cgit v1.2.3