Voice push-to-talk doesn't detect Space key press in iTerm2

Resolved 💬 3 comments Opened Mar 27, 2026 by ashe-li Closed Mar 30, 2026

Description

Voice mode "Hold Space to record" doesn't work — pressing Space is not detected as a push-to-talk trigger.

Root Cause

Claude Code enables the Kitty keyboard protocol with flags ~3 (disambiguate + event types), but does NOT include flag 8 (report all keys as escape codes). Since Space (U+0020) is not an ambiguous key, the terminal sends it as plain ASCII 0x20 on press — indistinguishable from regular text input. Only the release event is sent as CSI u (\x1b[32;1:3u).

With flags=11 (1+2+8), the terminal correctly sends:

  • Press: \x1b[32u (CSI u format)
  • Release: \x1b[32;1:3u (CSI u, event type 3)

Reproduction Steps

  1. Enable voice mode: set voiceEnabled: true in ~/.claude/settings.json
  2. Start Claude Code in iTerm2
  3. Run /voice to enable voice mode (shows "Hold Space to record")
  4. Hold Space — nothing happens (no recording indicator)

Evidence

Using a Python test script to probe the Kitty keyboard protocol:

With flags=3 (current behavior):

Press:   0x20 (plain ASCII — indistinguishable from typing)
Release: \x1b[32;1:3u (CSI u, event type 3)

With flags=11 (proposed fix):

Press:   \x1b[32u (CSI u — properly identifiable)
Release: \x1b[32;1:3u (CSI u, event type 3)

Suggested Fix

Add flag 8 to the Kitty keyboard protocol activation sequence when voice mode is enabled:
\x1b[>11u instead of \x1b[>3u (or whatever is currently used).

Environment

  • Claude Code: 2.1.85 (Mach-O arm64)
  • Terminal: iTerm2 3.6.8
  • macOS: Darwin 25.3.0 (arm64)
  • voiceEnabled: true in settings.json
  • Microphone + Input Monitoring permissions: granted to iTerm.app

View original on GitHub ↗

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