[BUG] Caps Lock (IME toggle) sends raw [57358u escape sequence in VS Code integrated terminal

Resolved 💬 4 comments Opened Mar 26, 2026 by eiei114 Closed Apr 18, 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?

When using Caps Lock as an IME (Input Method Editor) toggle to switch between English and Japanese input on macOS, pressing Caps Lock inserts the raw escape sequence [57358u into the Claude Code prompt. This is a CSI u sequence (Kitty keyboard protocol) for the Caps Lock key that Claude Code does not consume/discard.

This happens every single time the user switches input methods, making Claude Code very difficult to use for Japanese users.

What Should Happen?

Claude Code should silently consume/discard the Kitty keyboard protocol event for Caps Lock (keycode 57358) without inserting any text into the input buffer.

Error Messages/Logs

No error message. Raw text [57358u is inserted into the input field each time Caps Lock is pressed.

Steps to Reproduce

  1. Use macOS with Caps Lock configured as IME toggle (System Settings → Keyboard → Input Sources → "Use Caps Lock to switch input source")
  2. Open VS Code integrated terminal
  3. Launch Claude Code with claude
  4. Press Caps Lock to switch between English and Japanese input
  5. [57358u appears in the input prompt
  6. Every subsequent Caps Lock press inserts another [57358u

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.84

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

This primarily affects Japanese (and Chinese/Korean) users on macOS who use Caps Lock as an IME toggle — a very common configuration. The Kitty keyboard protocol reports Caps Lock as keycode 57358 (CSI 57358 u), and Claude Code's input handler does not filter this event.
Workaround: Use the fn/Globe (🌐) key for input switching instead of Caps Lock, but this is not ideal for users with established muscle memory.

View original on GitHub ↗

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