Alt+numeric keypad character input stops working in Codex TUI
Open 💬 1 comment Opened Aug 23, 2026 by bar971
What version of Codex CLI is running?
0.149.0
What subscription do you have?
pro
Which model were you using?
any
What platform is your computer?
windows 11
What terminal emulator and version are you using (if applicable)?
powershell 7
Codex doctor report
What issue are you seeing?
Alt+numeric keypad character input stops working in Codex TUI
What steps can reproduce the bug?
Steps to reproduce:
- Open a normal PowerShell 7 session.
- Press Alt+0126 using the numeric keypad. It correctly produces the
~character. - Start Codex by running
codex. - In the Codex interactive TUI, press Alt+0126 again.
- Exit Codex and try Alt+0126 once more in PowerShell.
What is the expected behavior?
Alt+numeric keypad input should produce the corresponding character while using the Codex TUI.
Additional information
Actual behavior:
Alt+0126 does not insert the ~ character while Codex is running. After exiting Codex, the same key combination works
normally again in PowerShell.
This suggests that Codex’s Windows terminal input handling intercepts or disables Alt+numeric keypad character
composition.
1 Comment
Root cause identified; a tested fix is available on a fork branch if maintainers want it.
Mechanism
Traced through crossterm 0.29's Windows input parser (
event/sys/windows/parse.rs):is_only_alt_modifier && is_numpad_numeric_keyreturns None), so no digit events ever reach the app.KeyEvent { code: Char(ch), modifiers: ALT, kind: KeyEventKind::Release }.has_ctrl_or_altintui/src/key_hint.rs, plus the ALT guards inbottom_pane/textarea.rsandchat_composer.rs; those guards are what keep real shortcuts such as Alt+A distinct from typed text, and shortcuts always arrive as presses).Net effect on Windows: the whole sequence produces zero usable events, so nothing gets inserted.
Suggested fix shape
Rewrite char-bearing release events that hold ALT (without CTRL) into plain modifier-free presses in
TuiEventStream::map_crossterm_event, before shortcut guards run. Such an event cannot be anything but an Alt code synthesis result: ordinary key releases carry no meaningful character payload on this path, while real shortcuts are presses, so no shortcut behavior changes.Constraints to preserve:
Implementation
Unit tests plus a stream-level test using the exact event crossterm produces (Windows-gated, will run on the Windows CI lane):
codex-rs/tui/src/tui/windows_composition.rswired intocodex-rs/tui/src/tui/event_stream.rsHappy to adjust the shape, or to open the PR if invited.