[BUG] Caps Lock (keycode 57358) leaks as raw [57358u text in kitty keyboard protocol terminals

Resolved 💬 9 comments Opened Mar 25, 2026 by zpoint Closed Mar 25, 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 Claude Code runs in VSCode's integrated terminal, pressing Caps Lock outputs raw [57358u escape sequences into the input line. 57358 is the CAPS_LOCK keycode in the kitty keyboard protocol spec.

This happens regardless of the VSCode setting terminal.integrated.keyboard.enableKeyboardProtocol (both true and false). That setting only affects the plain VSCode terminal itself — Claude Code appears to independently activate kitty protocol via a CSI ? u probe.

This does not happen in Windows Terminal (where Claude Code does not activate kitty protocol) or when running Claude inside tmux in VSCode (which intercepts kitty protocol sequences).

What Should Happen?

Claude Code should silently ignore modifier-only key events (Caps Lock 57358, Num Lock 57360, Scroll Lock 57359, etc.) when kitty protocol is active, rather than passing them through as raw text.

Steps to Reproduce

  1. VSCode 1.112.0 on WSL2 (Windows 11)
  2. Open integrated terminal (bash)
  3. Run claude
  4. Press Caps Lock → [57358u appears in the input field
  5. Exit Claude → Caps Lock no longer produces visible output

Note: The VSCode setting terminal.integrated.keyboard.enableKeyboardProtocol does NOT affect this issue. With true or false, Claude still shows the escape sequences. That setting only controls whether the plain VSCode terminal (without Claude) handles kitty protocol properly.

Workaround

  • Inside VSCode, changing the default terminal profile to tmux works. Using bash as the terminal profile does not.
  • Using Windows Terminal instead of VSCode terminal also works (Claude does not activate kitty protocol there).

Claude Model

Opus

Is this a regression?

Yes, started recently (likely related to VSCode 1.109+ adding kitty keyboard protocol support in xterm.js, causing Claude's CSI probe to get a positive response)

Claude Code Version

2.1.83

Platform

Anthropic API

Operating System

Windows (WSL2)

Terminal/Shell

VS Code integrated terminal (bash)

Additional Information

  • VSCode: 1.112.0
  • TERM: xterm-256color
  • Windows Terminal v1.23 works fine (kitty protocol not activated by Claude)

View original on GitHub ↗

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