[BUG] Numeric keypad disabled (application keypad mode) when Claude Code starts
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
## Description
When Claude Code starts, the numeric keypad stops sending numbers and appears to be disabled. This affects physical keyboards with a dedicated 10-key numpad.
## Environment
- macOS
- External keyboard with numeric keypad (Unicomp buckling spring)
- Terminal: ITerm2
## Expected behavior
Numeric keypad should continue to function normally, sending number characters.
## Actual behavior
After launching Claude Code, numpad keys no longer produce numbers. The keypad appears to be switched into application keypad mode (sending escape sequences instead of digits).
## Possible cause
Claude Code may be enabling terminal application keypad mode (tput smkx / \e[?1h) for input handling and not restoring it properly on exit or during operation.
What Should Happen?
- Claude Code should preserve the terminal's existing keypad mode on startup
- If application keypad mode is required for functionality, it should be scoped to specific input contexts and restored afterward
- The numeric keypad should remain functional for entering numbers throughout the session
- On exit (normal or abnormal), terminal state should be fully restored including keypad mode
Error Messages/Logs
❯ [57403u[57404u[57405u[57414u
Steps to Reproduce
## Steps to Reproduce
- Connect external keyboard with numeric keypad
- Open terminal (iTerm2 / Terminal.app)
- Verify numpad works - type numbers using 10-key
- Launch Claude Code:
claude - Attempt to type numbers using numpad
- Observe: numpad no longer produces numbers
- Exit Claude Code with
/exit - Numpad may or may not be restored depending on exit type
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.2 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
<img width="355" height="112" alt="Image" src="https://github.com/user-attachments/assets/2ce5f217-df25-4b2d-aa5a-efafa36bf2b3" />
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗