mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -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 {
|
interface AppContainerProps {
|
||||||
config: Config;
|
config: Config;
|
||||||
startupWarnings?: string[];
|
startupWarnings?: string[];
|
||||||
@@ -918,8 +928,11 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|||||||
...pendingSlashCommandHistoryItems,
|
...pendingSlashCommandHistoryItems,
|
||||||
...pendingGeminiHistoryItems,
|
...pendingGeminiHistoryItems,
|
||||||
];
|
];
|
||||||
|
if (isToolAwaitingConfirmation(pendingHistoryItems)) {
|
||||||
|
return; // Don't clear - user may be composing a follow-up message
|
||||||
|
}
|
||||||
if (isToolExecuting(pendingHistoryItems)) {
|
if (isToolExecuting(pendingHistoryItems)) {
|
||||||
buffer.setText(''); // Just clear the prompt
|
buffer.setText(''); // Clear for Ctrl+C cancellation
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user