Caps Lock (Korean/English IME switch) key inputs raw '[57358u' in CLI prompt
Description
When pressing the Caps Lock key to switch between Korean/English input methods (standard macOS IME switching), the raw Kitty keyboard protocol sequence [57358u is inserted into the CLI input field.
Steps to Reproduce
- Use macOS with Caps Lock configured for Korean/English IME switching (default macOS Korean keyboard setting)
- Open Claude Code CLI
- Press Caps Lock to switch input language in the CLI input prompt
- The string
[57358uappears in the input field
Expected Behavior
Caps Lock key events should be consumed/filtered and not passed through as text input. The IME switch should happen silently.
Actual Behavior
The escape sequence \e[57358u (Kitty keyboard protocol encoding for Caps Lock, keycode 57358) is not properly handled, and the visible portion [57358u is inserted as text.
Environment
- macOS (Darwin 24.5.0, Apple Silicon)
- Claude Code CLI (also reproducible in Claude Code desktop app's built-in terminal)
- Shell: zsh
- IME: macOS default Korean input (Caps Lock to toggle Korean/English)
Analysis
The CLI input handler enables the Kitty keyboard protocol for enhanced key handling, but does not filter/consume modifier-only key events like Caps Lock. The CSI u sequence for Caps Lock (\e[57358u) is passed through as literal text instead of being recognized as a non-printable key event.
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗