fix: satisfy terminal UI type checking

This commit is contained in:
archipelago
2026-10-09 09:03:10 -04:00
parent 540f581927
commit d041f498cf
+2 -1
View File
@@ -91,7 +91,8 @@ function onKeydown(event: KeyboardEvent) {
if (event.ctrlKey && event.key.toLowerCase() === 'c') { event.preventDefault(); send('\u0003'); return }
if (event.ctrlKey && event.key.toLowerCase() === 'd') { event.preventDefault(); send('\u0004'); return }
const special: Record<string, string> = { Enter: '\n', Backspace: '\u007f', Tab: '\t', ArrowUp: '\u001b[A', ArrowDown: '\u001b[B', ArrowRight: '\u001b[C', ArrowLeft: '\u001b[D' }
if (special[event.key]) { event.preventDefault(); send(special[event.key]); return }
const specialKey = special[event.key]
if (specialKey !== undefined) { event.preventDefault(); send(specialKey); return }
if (event.key.length === 1 && !event.metaKey && !event.altKey) { event.preventDefault(); send(event.key) }
}
function focusInput() { nextTick(() => inputRef.value?.focus()) }