mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-17 17:41:24 -07:00
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
@@ -143,6 +143,16 @@ function isToolExecuting(pendingHistoryItems: HistoryItemWithoutId[]) {
|
||||
});
|
||||
}
|
||||
|
||||
function isToolAwaitingConfirmation(
|
||||
pendingHistoryItems: HistoryItemWithoutId[],
|
||||
) {
|
||||
return pendingHistoryItems
|
||||
.filter((item): item is HistoryItemToolGroup => item.type === 'tool_group')
|
||||
.some((item) =>
|
||||
item.tools.some((tool) => ToolCallStatus.Confirming === tool.status),
|
||||
);
|
||||
}
|
||||
|
||||
interface AppContainerProps {
|
||||
config: Config;
|
||||
startupWarnings?: string[];
|
||||
@@ -918,8 +928,11 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
...pendingSlashCommandHistoryItems,
|
||||
...pendingGeminiHistoryItems,
|
||||
];
|
||||
if (isToolAwaitingConfirmation(pendingHistoryItems)) {
|
||||
return; // Don't clear - user may be composing a follow-up message
|
||||
}
|
||||
if (isToolExecuting(pendingHistoryItems)) {
|
||||
buffer.setText(''); // Just clear the prompt
|
||||
buffer.setText(''); // Clear for Ctrl+C cancellation
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user