Caps Lock key event leaks as raw text `[57358u` into input
Status Closed — duplicate
Maintainer reply ✓ Yes — claude[bot]
Activity 12 comments · opened Mar 26, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (claude[bot], contributor)
responded on this thread — see the highlighted reply below.
Description
When pressing Caps Lock (e.g. to switch input sources between English/Japanese on macOS with a US keyboard), the Kitty Keyboard Protocol escape sequence for Caps Lock (ESC[57358u) leaks into the Claude Code input field as literal text [57358u.
Steps to Reproduce
- Use macOS with a US keyboard layout
- Configure Caps Lock as input source switcher (English ↔ Japanese) in System Settings → Keyboard → Input Sources
- Open Claude Code in VSCode integrated terminal (VSCode 1.111)
- Press Caps Lock to switch input source
- Observe
[57358uis inserted into the input field
Expected Behavior
Caps Lock key events should be silently consumed and not passed through as text input. Keycode 57358 is the Kitty Keyboard Protocol code for Caps Lock — it should be recognized and ignored.
Actual Behavior
The escape sequence ESC[57358u is partially rendered as [57358u in the input field (the ESC character is invisible, so only [57358u appears).
Environment
- Claude Code: v2.1.84
- Terminal: VSCode integrated terminal (v1.111)
- OS: macOS (Darwin 23.6.0)
- TERM: xterm-256color
- Keyboard: US layout, Caps Lock mapped to input source switching
Notes
- Setting
"terminal.integrated.keyboard.protocol": "xterm"in VSCode settings does not resolve the issue, as Claude Code appears to enable the Kitty Keyboard Protocol independently - This likely affects other modifier-only key events in the Kitty protocol as well (e.g. Shift, Ctrl, Alt alone)
- No
hidutilkey remapping or Karabiner-Elements installed
12 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
same here. Apple Magic Keyboard Chinese <-> English produces
[57358u.So we are all in the same boat ig - same here with Windows producing [57358u
Experiencing the same issue on Windows 11 too, VSCode integrated terminal with PowerShell.
Claude Code version: 2.1.84
Experiencing this same issue. Commented on another issue that is experiencing the same thing
when i /exit, it affects the terminal outside of claude where its the unicode or whatever its called thats being displayed for spacebar and backspace button
Oh my god, I just bought a new keyboard thinking that was the issue (it was also doing other things, not just this). The other things are fixed, but this remained.
I'm so glad I'm not insane.
Same here, on macOS with Spanish keyboard and VSCode
Same here, on macOS and VSCode
Same, Windows 11 within VSCode
/tmp/kitty-comment2.md
This is a duplicate of #38602, which was fixed as of version 2.1.85.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.