feat: save prompt to history when cleared with Ctrl+C
When users press Ctrl+C to clear the input field, the current prompt is now saved to history before clearing. This allows users to navigate back to cleared prompts using arrow keys, preventing loss of work. Addresses #11489
This commit is contained in:
parent
2c82e6c6ae
commit
738d6c8899
1 changed files with 4 additions and 0 deletions
|
|
@ -832,6 +832,10 @@ export function Prompt(props: PromptProps) {
|
|||
// If no image, let the default paste behavior continue
|
||||
}
|
||||
if (keybind.match("input_clear", e) && store.prompt.input !== "") {
|
||||
history.append({
|
||||
...store.prompt,
|
||||
mode: store.mode,
|
||||
})
|
||||
input.clear()
|
||||
input.extmarks.clear()
|
||||
setStore("prompt", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue