[BUG] Scroll Lock key causes Claude Code to exit in VS Code integrated terminal (Windows 11)

Status Open
Reported on v2.1.215
Maintainer reply None cached
Activity 1 comment · opened Jul 20, 2026

Summary

When Claude Code runs inside the VS Code integrated terminal on Windows 11, pressing the Scroll Lock key makes Claude Code exit immediately, dropping me back to the shell prompt in the original directory. This looks related to the known kitty keyboard protocol / modifier-only key issues (#38624, #38581, #39188, #39317, #39345), but in my case the key does not just leak [57359u into the input line, it actually terminates the session.

Environment

  • Claude Code version: 2.1.215
  • OS: Windows 11 Pro (10.0.26200)
  • Terminal: VS Code integrated terminal
  • Shell: PowerShell
  • Model: Opus 4.8

Steps to reproduce

  1. Open the integrated terminal in VS Code.
  2. Run claude.
  3. Press the Scroll Lock key.

Actual behavior

Claude Code exits and I am returned to the shell prompt in the current working directory, as if the app had quit.

Expected behavior

Modifier-only / lock keys (Scroll Lock keycode 57359, Caps Lock 57358, Num Lock 57360) should be silently ignored, exactly as requested in #38624. They should never insert text and never cause the app to exit.

Important scoping detail

This does NOT happen in a standalone PowerShell window or in CMD, where Scroll Lock does nothing. It only happens in the VS Code integrated terminal. This matches the pattern where VS Code 1.109+ added kitty keyboard protocol support to xterm.js and Claude Code activates the protocol via the CSI ? u probe, so the raw [57359u sequence reaches the TUI. Codex CLI does not exhibit this in the same terminal.

Workarounds tried

  • terminal.integrated.keyboard.enableKeyboardProtocol: false in VS Code settings: does not help (Claude Code activates the protocol independently).
  • Running Claude Code in Windows Terminal instead: no issue there (kitty protocol is not activated).
  • Disabling the Scroll Lock key at the OS level (PowerToys Keyboard Manager): avoids the problem but is a workaround, not a fix.

Related issues

  • #38624 Caps Lock leaks as raw [57358u text in kitty keyboard protocol terminals
  • #38581, #39188, #39317, #39345 same family of lock-key leak reports
  • #38761 terminal left in enhanced keyboard mode after exit

I can capture and attach claude --debug output showing the exact escape sequence emitted on the Scroll Lock keypress if that would help narrow it down.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗