[BUG]

Resolved 💬 3 comments Opened Jan 11, 2026 by klueless-io Closed Jan 15, 2026

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?

Bug Report: Numeric Keypad Inputs Display as Escape Sequences in Claude Code Terminal

Summary

Numeric keypad keys display as raw escape sequences (e.g., [57402u, [57403u, [57407u) instead of digits in Claude Code's integrated terminal. This issue only occurs in Claude Code - the same setup works correctly in iTerm2.

Environment

  • Claude Code Version: [Your version - check Help → About]
  • OS: macOS (Darwin 24.6.0)
  • Terminal Emulator: iTerm2 (primary terminal)
  • Shell: zsh
  • tmux Version: 3.5a
  • TERM: xterm-256color (likely)

Steps to Reproduce

  1. Open Claude Code
  2. Open integrated terminal
  3. Press any numeric keypad key (0-9, Enter, +, -, *, /)
  4. Observe raw escape sequences appear instead of the expected character

Expected Behavior

Numeric keypad should input digits (0-9) and operators (+, -, *, /, Enter) just like the top row number keys.

Actual Behavior

Numeric keypad keys output raw CSI u format escape sequences:

  • [57402u
  • [57403u
  • [57407u

These appear to be modern keyboard protocol keycodes (CSI u format) that Claude Code's terminal is not interpreting.

Important Context

This ONLY happens in Claude Code's terminal. The exact same setup works perfectly in:

  • iTerm2 (native terminal)
  • tmux within iTerm2
  • Other terminal applications

This confirms the issue is specific to Claude Code's terminal implementation, not:

  • macOS keyboard settings
  • iTerm2 configuration
  • tmux configuration
  • Shell configuration

Attempted Fixes (None Worked)

I have tried all the following without success:

1. Terminal State Resets

printf '\033[?1000l\033[?1003l\033[?1006l'  # Disable mouse tracking
printf '\033>'                               # Exit keypad application mode
reset                                        # Full terminal reset
tput rmkx                                    # Remove keypad mode

2. iTerm2 Settings

  • Disabled "Allow application keypad mode"
  • Disabled "Use Kitty keyboard protocol"
  • Disabled "Report modifiers using CSI u"
  • Restarted Claude Code after each change

3. tmux Configuration

# Added to ~/.tmux.conf:
set -g extended-keys off
set -g terminal-overrides ',*:rmkx'

4. Environment Variables

export TERM=xterm-256color

None of these fixes resolved the issue in Claude Code, despite some being effective for similar issues in other terminals.

Technical Analysis

The escape sequences [57402u, [57403u, [57407u are:

  • Format: CSI u (modern keyboard protocol)
  • Standard: Part of the Kitty keyboard protocol / extended key reporting
  • Purpose: Provide unambiguous key identification with modifiers

These sequences suggest:

  1. iTerm2 is sending modern keyboard protocol codes
  2. Claude Code's terminal is receiving them
  3. Claude Code is not interpreting them, just displaying raw bytes
  4. Other terminals (iTerm2) correctly interpret these sequences

Comparison with Similar Issues

This appears related to:

However, this is numeric keypad specific and cannot be resolved with the workarounds that fixed those issues.

Impact

Severity: Medium

  • Numeric keypad is unusable in Claude Code terminal
  • Workaround: Use top row number keys
  • Does not affect Claude Code's main functionality
  • Reduces productivity for users who rely on numeric keypad

Requested Fix

Claude Code's terminal should:

  1. Detect and interpret CSI u format escape sequences
  2. Map numeric keypad sequences to their corresponding digits/operators
  3. Maintain compatibility with modern keyboard protocols

Alternatively:

  • Provide a setting to disable modern keyboard protocol in Claude Code's terminal
  • Document how to configure terminal keyboard handling

Additional Information

I'm happy to:

  • Provide additional debugging output
  • Test patches or fixes
  • Provide my full iTerm2/tmux configuration if helpful

Thank you for investigating this issue!

What Should Happen?

I should be able to use numbers on number keypad

Error Messages/Logs

❯ [57400u[57402u

Steps to Reproduce

iterm
claude

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.4

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗