mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-11 13:51:10 -07:00
fix(ui): prevent escape key from cancelling requests in shell mode (#21245)
This commit is contained in:
@@ -686,13 +686,9 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
key.name === 'escape' &&
|
||||
(streamingState === StreamingState.Responding ||
|
||||
streamingState === StreamingState.WaitingForConfirmation)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
const isGenerating =
|
||||
streamingState === StreamingState.Responding ||
|
||||
streamingState === StreamingState.WaitingForConfirmation;
|
||||
|
||||
const isPlainTab =
|
||||
key.name === 'tab' && !key.shift && !key.alt && !key.ctrl && !key.cmd;
|
||||
@@ -877,6 +873,12 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
||||
return true;
|
||||
}
|
||||
|
||||
// If we're generating and no local overlay consumed Escape, let it
|
||||
// propagate to the global cancellation handler.
|
||||
if (isGenerating) {
|
||||
return false;
|
||||
}
|
||||
|
||||
handleEscPress();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user