feat(cli): clear input buffer on CTRL+C when not executing commands (#1729)

Co-authored-by: Scott Densmore <scottdensmore@mac.com>
This commit is contained in:
Matias
2025-07-16 00:35:58 -03:00
committed by GitHub
parent 0903421b1a
commit d622e596a1
2 changed files with 37 additions and 0 deletions

View File

@@ -356,6 +356,16 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
}
if (key.ctrl && key.name === 'e') {
buffer.move('end');
buffer.moveToOffset(cpLen(buffer.text));
return;
}
// Ctrl+C (Clear input)
if (key.ctrl && key.name === 'c') {
if (buffer.text.length > 0) {
buffer.setText('');
resetCompletionState();
return;
}
return;
}
@@ -397,6 +407,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
handleSubmitAndClear,
shellHistory,
handleClipboardImage,
resetCompletionState,
],
);