Fix Esc cancel during streaming (#18039)

This commit is contained in:
Dmitry Lyalin
2026-02-01 08:16:14 -08:00
committed by GitHub
parent b0f38104d7
commit cb4f0c6fa4

View File

@@ -482,6 +482,14 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
return false;
}
if (
key.name === 'escape' &&
(streamingState === StreamingState.Responding ||
streamingState === StreamingState.WaitingForConfirmation)
) {
return false;
}
if (key.name === 'paste') {
// Record paste time to prevent accidental auto-submission
if (!isTerminalPasteTrusted(kittyProtocol.enabled)) {
@@ -977,6 +985,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
backgroundShells.size,
backgroundShellHeight,
history,
streamingState,
],
);