Add Esc-Esc to clear prompt when it's not empty (#17131)

This commit is contained in:
Adib234
2026-01-20 19:32:26 -05:00
committed by GitHub
parent 3b626e7c61
commit e1fd5be429
7 changed files with 82 additions and 12 deletions

View File

@@ -45,7 +45,18 @@ export const StatusDisplay: React.FC<StatusDisplayProps> = ({
}
if (uiState.showEscapePrompt) {
return <Text color={theme.text.secondary}>Press Esc again to rewind.</Text>;
const isPromptEmpty = uiState.buffer.text.length === 0;
const hasHistory = uiState.history.length > 0;
if (isPromptEmpty && !hasHistory) {
return null;
}
return (
<Text color={theme.text.secondary}>
Press Esc again to {isPromptEmpty ? 'rewind' : 'clear prompt'}.
</Text>
);
}
if (uiState.queueErrorMessage) {