feat: allow ctrl+d to exit the app (#3636)

This commit is contained in:
Nathan Thomas
2025-10-31 14:27:41 -07:00
committed by GitHub
parent 9e392f25a6
commit e630d680dd
4 changed files with 19 additions and 2 deletions

View File

@@ -530,6 +530,17 @@ export function Prompt(props: PromptProps) {
setStore("extmarkToPartIndex", new Map())
return
}
if (keybind.match("input_forward_delete", e) && store.prompt.input !== "") {
const cursorOffset = input.cursorOffset
if (cursorOffset < input.plainText.length) {
const text = input.plainText
const newText = text.slice(0, cursorOffset) + text.slice(cursorOffset + 1)
input.setText(newText)
input.cursorOffset = cursorOffset
}
e.preventDefault()
return
}
if (keybind.match("app_exit", e)) {
await exit()
return