feat: add Rewind Confirmation dialog and Rewind Viewer component (#15717)

This commit is contained in:
Adib234
2026-01-14 10:22:21 -05:00
committed by GitHub
parent 3b55581aaf
commit dfb7dc7069
19 changed files with 1318 additions and 27 deletions

View File

@@ -495,11 +495,8 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
return;
}
// Handle double ESC for clearing input
// Handle double ESC for rewind
if (escPressCount.current === 0) {
if (buffer.text === '') {
return;
}
escPressCount.current = 1;
setShowEscapePrompt(true);
if (escapeTimerRef.current) {
@@ -509,10 +506,9 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
resetEscapeState();
}, 500);
} else {
// clear input and immediately reset state
buffer.setText('');
resetCompletionState();
// Second ESC triggers rewind
resetEscapeState();
onSubmit('/rewind');
}
return;
}
@@ -881,6 +877,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
kittyProtocol.enabled,
tryLoadQueuedMessages,
setBannerVisible,
onSubmit,
activePtyId,
setEmbeddedShellFocused,
],