cr8rcho
Development

Fixing the [57358u Escape Sequence When Pressing Caps Lock in VS Code

Mar 27
2 min

Fixing the [57358u Escape Sequence When Pressing Caps Lock in VS Code

Since VS Code 1.112.0 on macOS, pressing the Caps Lock key inserts the literal text [57358u into chat input fields. This is especially noticeable in the Claude Code extension panel and the integrated terminal.


Symptoms

  • Click into a chat input field or terminal in VS Code
  • Press Caps Lock
  • [57358u is inserted as literal text
  • Particularly frequent for users who use Caps Lock for input method switching

Cause

VS Code 1.112.0 enabled the Kitty keyboard protocol by default. The Kitty protocol is an extended terminal protocol for more precise key input handling, but the Caps Lock escape sequence ([57358u) is not properly handled in chat input fields and gets inserted as raw text.

GitHub issue: microsoft/vscode#304679

Fix

  1. Open the Command Palette in VS Code (CMD + Shift + P)
  2. Select Preferences: Open User Settings (JSON)
  3. Add the following setting:
"terminal.integrated.enableKittyKeyboardProtocol": false
  1. Restart VS Code.

Trade-offs

Disabling this setting means you lose the Kitty protocol's extended key input features (modifier key combinations, etc.). However, most users won't notice any difference in everyday use. Use this as a workaround until the issue is officially fixed.