Caps Lock keypress leaks '[57358u' into input when using VS Code integrated terminal

Resolved 💬 5 comments Opened Mar 25, 2026 by Yoon0717 Closed Mar 25, 2026

Bug Report

Environment:

  • Claude Code in VS Code integrated terminal
  • VS Code has terminal.integrated.enableKittyProtocol enabled (default since VS Code 1.86)
  • macOS

Description

Every time Caps Lock is pressed, the literal string [57358u appears in the Claude Code input field. This does not happen in other terminals (iTerm2, Terminal.app, etc.).

Root Cause

VS Code's integrated terminal advertises Kitty keyboard protocol support and sends modifier-only key events (e.g. Caps Lock = keycode 57358). Claude Code receives the raw escape sequence \e[57358u but does not filter/discard modifier-only key events that produce no printable character, causing them to leak into the input as literal text.

Expected Behavior

Modifier-only key events (Caps Lock, Shift, Ctrl, Alt, etc.) should be silently ignored by Claude Code and never appear as text in the input.

Workaround

Disabling terminal.integrated.enableKittyProtocol in VS Code fixes the noise, but breaks Shift+Enter (newline in Claude Code input) since the terminal can no longer distinguish Shift+Enter from Enter without the Kitty protocol.

Suggested Fix

Claude Code should filter out modifier-only key events (keycodes with no associated printable character) received via the Kitty keyboard protocol before passing them to the input handler.

View original on GitHub ↗

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