mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 12:04:56 -07:00
feat(cli): Prevent queuing of slash and shell commands (#11094)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -93,6 +93,7 @@ import { useExtensionUpdates } from './hooks/useExtensionUpdates.js';
|
||||
import { ShellFocusContext } from './contexts/ShellFocusContext.js';
|
||||
|
||||
const CTRL_EXIT_PROMPT_DURATION_MS = 1000;
|
||||
const QUEUE_ERROR_DISPLAY_DURATION_MS = 3000;
|
||||
|
||||
function isToolExecuting(pendingHistoryItems: HistoryItemWithoutId[]) {
|
||||
return pendingHistoryItems.some((item) => {
|
||||
@@ -154,6 +155,10 @@ export const AppContainer = (props: AppContainerProps) => {
|
||||
config.isTrustedFolder(),
|
||||
);
|
||||
|
||||
const [queueErrorMessage, setQueueErrorMessage] = useState<string | null>(
|
||||
null,
|
||||
);
|
||||
|
||||
const extensions = config.getExtensions();
|
||||
const {
|
||||
extensionsUpdateState,
|
||||
@@ -815,6 +820,17 @@ Logging in with Google... Please restart Gemini CLI to continue.
|
||||
}
|
||||
}, [ideNeedsRestart]);
|
||||
|
||||
useEffect(() => {
|
||||
if (queueErrorMessage) {
|
||||
const timer = setTimeout(() => {
|
||||
setQueueErrorMessage(null);
|
||||
}, QUEUE_ERROR_DISPLAY_DURATION_MS);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
return undefined;
|
||||
}, [queueErrorMessage, setQueueErrorMessage]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isInitialMount.current) {
|
||||
isInitialMount.current = false;
|
||||
@@ -1131,6 +1147,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
|
||||
currentLoadingPhrase,
|
||||
historyRemountKey,
|
||||
messageQueue,
|
||||
queueErrorMessage,
|
||||
showAutoAcceptIndicator,
|
||||
showWorkspaceMigrationDialog,
|
||||
workspaceExtensions,
|
||||
@@ -1212,6 +1229,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
|
||||
currentLoadingPhrase,
|
||||
historyRemountKey,
|
||||
messageQueue,
|
||||
queueErrorMessage,
|
||||
showAutoAcceptIndicator,
|
||||
showWorkspaceMigrationDialog,
|
||||
workspaceExtensions,
|
||||
@@ -1276,6 +1294,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
|
||||
onWorkspaceMigrationDialogOpen,
|
||||
onWorkspaceMigrationDialogClose,
|
||||
handleProQuotaChoice,
|
||||
setQueueErrorMessage,
|
||||
}),
|
||||
[
|
||||
handleThemeSelect,
|
||||
@@ -1301,6 +1320,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
|
||||
onWorkspaceMigrationDialogOpen,
|
||||
onWorkspaceMigrationDialogClose,
|
||||
handleProQuotaChoice,
|
||||
setQueueErrorMessage,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user