Summary
OpenTUI textarea/input handling ignores numeric keypad keys. This is visible in opencode TUI: top-row digits work, but the entire numpad is ignored, including digits, operators, and numpad Enter.
Environment
- OS: macOS
- Terminals tested: iTerm2 and VS Code integrated terminal
- App observed: opencode TUI
- OpenTUI version used by opencode: 0.2.5
Reproduction
- Open opencode TUI.
- Focus the prompt textarea.
- Press top-row number keys: digits are inserted.
- Press numpad keys:
0-9, +, -, /, *, and numpad Enter are ignored.
Expected behavior
Numeric keypad keys should behave like their regular equivalents in text input:
0-9 insert digits
. inserts decimal point
/, *, -, + insert operators
- numpad Enter behaves like regular Enter / submit
Actual behavior
Numpad keys do nothing in the textarea/prompt.
Technical notes
opencode enables OpenTUI keyboard handling with:
OpenTUI already recognizes keypad key names such as kp0, kp1, kpplus, and kpenter in packages/core/src/lib/parse.keypress-kitty.ts, and the keymap parser lists those names in packages/keymap/src/addons/universal/default-parser.ts.
The missing piece appears to be textarea normalization. Textarea.handleKeyPress() in packages/core/src/renderables/Textarea.ts special-cases space and otherwise inserts printable key.sequence, but it does not translate kp* key names into text/actions.
Suggested behavior:
kp0-kp9 -> 0-9
kpdecimal -> .
kpdivide -> /
kpmultiply -> *
kpminus -> -
kpplus -> +
kpenter -> regular Enter / submit
Summary
OpenTUI textarea/input handling ignores numeric keypad keys. This is visible in opencode TUI: top-row digits work, but the entire numpad is ignored, including digits, operators, and numpad Enter.
Environment
Reproduction
0-9,+,-,/,*, and numpad Enter are ignored.Expected behavior
Numeric keypad keys should behave like their regular equivalents in text input:
0-9insert digits.inserts decimal point/,*,-,+insert operatorsActual behavior
Numpad keys do nothing in the textarea/prompt.
Technical notes
opencode enables OpenTUI keyboard handling with:
OpenTUI already recognizes keypad key names such as
kp0,kp1,kpplus, andkpenterinpackages/core/src/lib/parse.keypress-kitty.ts, and the keymap parser lists those names inpackages/keymap/src/addons/universal/default-parser.ts.The missing piece appears to be textarea normalization.
Textarea.handleKeyPress()inpackages/core/src/renderables/Textarea.tsspecial-casesspaceand otherwise inserts printablekey.sequence, but it does not translatekp*key names into text/actions.Suggested behavior:
kp0-kp9->0-9kpdecimal->.kpdivide->/kpmultiply->*kpminus->-kpplus->+kpenter-> regular Enter / submit