diff --git a/neode-ui/src/components/CLIPopup.vue b/neode-ui/src/components/CLIPopup.vue index 039e7542..0a517fd1 100644 --- a/neode-ui/src/components/CLIPopup.vue +++ b/neode-ui/src/components/CLIPopup.vue @@ -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 = { 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()) }