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

  1. Use macOS with a US keyboard layout
  2. Configure Caps Lock as input source switcher (English ↔ Japanese) in System Settings → Keyboard → Input Sources
  3. Open Claude Code in VSCode integrated terminal (VSCode 1.111)
  4. Press Caps Lock to switch input source
  5. Observe [57358u is 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 hidutil key remapping or Karabiner-Elements installed

View original on GitHub ↗

12 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/39067
  2. https://github.com/anthropics/claude-code/issues/39128
  3. https://github.com/anthropics/claude-code/issues/39129

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

slankka · 5 months ago

same here. Apple Magic Keyboard Chinese <-> English produces [57358u.

clemulton70 · 5 months ago

So we are all in the same boat ig - same here with Windows producing [57358u

haadiyeah · 5 months ago

Experiencing the same issue on Windows 11 too, VSCode integrated terminal with PowerShell.
Claude Code version: 2.1.84

Deesteph55 · 5 months ago

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

CoreyAccel · 5 months ago

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.

carlosromanxyz · 5 months ago

Same here, on macOS with Spanish keyboard and VSCode

tharayuth · 5 months ago

Same here, on macOS and VSCode

WelshDev · 5 months ago

Same, Windows 11 within VSCode

yurukusa · 5 months ago

/tmp/kitty-comment2.md

claude[bot] contributor · 4 months ago

This is a duplicate of #38602, which was fixed as of version 2.1.85.

github-actions[bot] · 4 months ago

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.