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

Status Fixed / completed
Reported on v2.1.83
Maintainer reply None cached
Activity 9 comments · opened Mar 25, 2026 · 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 ↗

9 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/38581
  2. https://github.com/anthropics/claude-code/issues/38602
  3. https://github.com/anthropics/claude-code/issues/38604

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

devslimbr · 5 months ago

I'm experiencing the same problem.

arterial2539-1 · 5 months ago

+1 — Same issue on macOS (Darwin 24.6.0) with zsh terminal.

Pressing Caps Lock to switch input method (Thai ↔ English) outputs raw [57358u escape sequence into the input field. This breaks the normal language switching workflow.

Claude Code version: latest (post v2.1.83 regression).

stasyan-coza · 5 months ago

2.1.79 - is ok

ala-dojo · 5 months ago

I'm experiencing the same issue with the Shift (Maj) key on a French (AZERTY) keyboard layout.

Environment:

  • OS: Windows 11
  • Terminal: Git Bash inside VS Code integrated terminal
  • Claude Code version: 2.1.83 (Claude Code)
  • Keyboard layout: French (AZERTY)

What happens:
Pressing the Shift (Maj) key alone inserts [57358u as raw text into the Claude Code input line. This makes it very disruptive when typing, as any accidental lone Shift press pollutes the input.

simncg · 5 months ago

I'm experiencing the same issue.

xsyetopz · 5 months ago
2.1.79 - is ok

You were right! Even 2.1.80 has this problem. Thank you!

sathiranipun · 5 months ago

I also experienced this issue, and it was resolved after updating to Claude Code v2.1.89.

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.