diff options
Diffstat (limited to 'packages/cli/src/ui/components/messages')
| -rw-r--r-- | packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx | 45 | ||||
| -rw-r--r-- | packages/cli/src/ui/components/messages/ToolGroupMessage.tsx | 3 |
2 files changed, 14 insertions, 34 deletions
diff --git a/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx b/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx index af9aba6a..0de85ba4 100644 --- a/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx +++ b/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx @@ -13,7 +13,6 @@ import { ToolConfirmationOutcome, ToolExecuteConfirmationDetails, ToolMcpConfirmationDetails, - checkHasEditor, Config, } from '@gemini-cli/core'; import { @@ -24,14 +23,16 @@ import { export interface ToolConfirmationMessageProps { confirmationDetails: ToolCallConfirmationDetails; config?: Config; + isFocused?: boolean; } export const ToolConfirmationMessage: React.FC< ToolConfirmationMessageProps -> = ({ confirmationDetails, config }) => { +> = ({ confirmationDetails, config, isFocused = true }) => { const { onConfirm } = confirmationDetails; useInput((_, key) => { + if (!isFocused) return; if (key.escape) { onConfirm(ToolConfirmationOutcome.Cancel); } @@ -86,40 +87,12 @@ export const ToolConfirmationMessage: React.FC< }, ); - // Conditionally add editor options if editors are installed - const notUsingSandbox = !process.env.SANDBOX; const externalEditorsEnabled = config?.getEnableModifyWithExternalEditors() ?? false; - - if (checkHasEditor('vscode') && notUsingSandbox && externalEditorsEnabled) { - options.push({ - label: 'Modify with VS Code', - value: ToolConfirmationOutcome.ModifyVSCode, - }); - } - - if ( - checkHasEditor('windsurf') && - notUsingSandbox && - externalEditorsEnabled - ) { - options.push({ - label: 'Modify with Windsurf', - value: ToolConfirmationOutcome.ModifyWindsurf, - }); - } - - if (checkHasEditor('cursor') && notUsingSandbox && externalEditorsEnabled) { - options.push({ - label: 'Modify with Cursor', - value: ToolConfirmationOutcome.ModifyCursor, - }); - } - - if (checkHasEditor('vim') && externalEditorsEnabled) { + if (externalEditorsEnabled) { options.push({ - label: 'Modify with vim', - value: ToolConfirmationOutcome.ModifyVim, + label: 'Modify with external editor', + value: ToolConfirmationOutcome.ModifyWithEditor, }); } @@ -192,7 +165,11 @@ export const ToolConfirmationMessage: React.FC< {/* Select Input for Options */} <Box flexShrink={0}> - <RadioButtonSelect items={options} onSelect={handleSelect} /> + <RadioButtonSelect + items={options} + onSelect={handleSelect} + isFocused={isFocused} + /> </Box> </Box> ); diff --git a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx index b01e5f9b..8ce40893 100644 --- a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx +++ b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx @@ -17,6 +17,7 @@ interface ToolGroupMessageProps { toolCalls: IndividualToolCallDisplay[]; availableTerminalHeight: number; config?: Config; + isFocused?: boolean; } // Main component renders the border and maps the tools using ToolMessage @@ -24,6 +25,7 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({ toolCalls, availableTerminalHeight, config, + isFocused = true, }) => { const hasPending = !toolCalls.every( (t) => t.status === ToolCallStatus.Success, @@ -84,6 +86,7 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({ <ToolConfirmationMessage confirmationDetails={tool.confirmationDetails} config={config} + isFocused={isFocused} /> )} </Box> |
