Skip to content

fix: resolve #614 - numpad keys not working in VSCode terminal#258

Open
WqyJh wants to merge 1 commit into
mainfrom
mirror/pr-620
Open

fix: resolve #614 - numpad keys not working in VSCode terminal#258
WqyJh wants to merge 1 commit into
mainfrom
mirror/pr-620

Conversation

@WqyJh

@WqyJh WqyJh commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Fixes XiaomiMiMo#614

Summary

Fixes numpad keys (0-9, +, -, *, /, .) not registering any input when running MiMo Code in VSCode's integrated terminal or other terminals without kitty keyboard protocol.

Root Cause

@opentui/core's parseKeypress only maps UPPERCASE SS3 escape sequences to key names (e.g. \x1bOP -> "f1"). Numpad keys send lowercase SS3 sequences (e.g. \x1bOp for KP0, \x1bOq for KP1). These are parsed to name="" and then silently dropped by TextareaRenderable.handleKeyPress because the sequence starts with ESC (char code 27 < 32).

Terminals with kitty keyboard protocol (Kitty, Ghostty) are unaffected — they use CSI u mode which is correctly handled via kittyKeyMap.

Fix

Workaround in the prompt's onKeyDown handler: detect SS3 numpad sequences by their pattern (\x1bO + lowercase letter) and map them to the correct characters, inserting them directly into the textarea.

Also partially addresses Bug 2 (voice input silent failure) from the same issue, which is more fully fixed by PR XiaomiMiMo#613.

Testing

  • bunx turbo typecheck — all packages pass

Mirrored from XiaomiMiMo/MiMo-Code#620 — original author @MrRealORG.

The upstream @opentui/core parseKeypress only maps UPPERCASE SS3 escape
sequences (e.g. \x1bOP -> f1) to key names. Numpad keys send lowercase
SS3 sequences (e.g. \x1bOp for KP0) which are parsed to name="" and
then silently dropped by TextareaRenderable because the sequence starts
with ESC (char code 27 < 32).

This only affects terminals without kitty keyboard protocol (VSCode,
Windows Terminal, etc.). Terminals with kitty protocol use CSI u mode
which is correctly handled.

Workaround: in the prompt onKeyDown handler, detect SS3 numpad sequences
by their pattern (\x1bO + lowercase letter) and map them to the correct
characters, inserting them directly into the textarea input.

Also partially addresses the voice input issue (Bug 2 in XiaomiMiMo#614) which is
more fully fixed by PR XiaomiMiMo#613 (voice recording silent failure detection).

Fixes XiaomiMiMo#614
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Title: Numpad keys not working & Voice input microphone detection issue

1 participant