Caps Lock inserts raw Kitty protocol sequence [57358u in VSCode terminal input

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Mar 27, 2026 · closed Apr 18, 2026

Bug Description

When pressing Caps Lock in the Claude Code VSCode integrated terminal, the raw Kitty keyboard
protocol escape sequence [57358u is inserted into the input field as text.

## Steps to Reproduce

  1. Open Claude Code in VSCode integrated terminal
  2. Focus on the input field
  3. Press Caps Lock key

## Expected Behavior
Caps Lock should be silently ignored - it is a modifier-only key and should not produce any text
input.

## Actual Behavior
The string [57358u appears in the input field.

## Root Cause
VSCode terminal (xterm.js) uses the Kitty keyboard protocol, which encodes modifier keys as CSI
sequences. Caps Lock is sent as \e[57358u. Claude Code input handler does not filter out
modifier-only Kitty sequences, so the raw escape code is interpreted as literal text.

Other potentially affected keys:

  • Num Lock: 57360
  • Scroll Lock: 57359

## Suggested Fix
Filter out modifier-only Kitty protocol sequences in the terminal input handler so they are not
treated as text input.

## Environment

  • OS: macOS (Darwin 25.3.0)
  • Terminal: VSCode integrated terminal
  • Claude Code: CLI (latest)

View original on GitHub ↗

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