Voice push-to-talk doesn't detect Space key press in iTerm2
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
- Enable voice mode: set
voiceEnabled: truein~/.claude/settings.json - Start Claude Code in iTerm2
- Run
/voiceto enable voice mode (shows "Hold Space to record") - 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: truein settings.json- Microphone + Input Monitoring permissions: granted to iTerm.app
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗