Caps Lock key emits raw escape sequence [57358u in VS Code extension terminal

Resolved 💬 3 comments Opened Mar 25, 2026 by Anarkitty1 Closed Mar 29, 2026

Description

When pressing Caps Lock while the Claude Code terminal is focused in the VS Code extension, the raw kitty keyboard protocol escape sequence [57358u is printed to the terminal instead of being silently consumed.

This only happens in the Claude Code VS Code extension terminal — other VS Code integrated terminals and external terminals (iTerm2, Terminal.app) handle Caps Lock correctly.

Steps to Reproduce

  1. Open VS Code with the Claude Code extension installed
  2. Open a Claude Code session in the terminal panel (claudeCode.useTerminal: true)
  3. Press Caps Lock

Expected Behavior

Caps Lock press is silently consumed (toggles caps lock state without printing anything).

Actual Behavior

Each Caps Lock press prints [57358u to the terminal output. The sequence appears inline with other text.

Analysis

[57358u is a CSI u (kitty keyboard protocol) escape sequence. Keycode 57358 maps to Caps Lock in the kitty protocol spec. The Claude Code extension's terminal is enabling the kitty keyboard protocol but not filtering out modifier-only key events like Caps Lock.

Attempted Workarounds (did not fix)

  • Setting "terminal.integrated.keyboard.protocol": "xterm" in both user and workspace VS Code settings
  • Setting "terminal.integrated.sendKeybindingsToShell": false
  • Setting "terminal.integrated.enableExtendedKeybindings": false
  • Full restart of VS Code after applying settings

None of these override the Claude Code extension's own terminal behavior.

Environment

  • OS: macOS (Darwin 24.6.0)
  • VS Code Extension: Claude Code (latest)
  • Setting: claudeCode.useTerminal: true

View original on GitHub ↗

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