Skip to content

/voice mode collides with typing: Space is swallowed, so typed prompts run together and pick up stray transcriptions #936

Description

@euxaristia

Version / branch / commit

main @ 1ec7219

OS and environment

macOS (Darwin 27.0). Reproduces on both terminal tiers described in internal/tui/dictation_voice.go — those that report key-release events (hold-to-record) and those that don't (press-to-toggle).

Steps to reproduce

  1. Run /voice to turn voice mode on.
  2. Without turning it off, start typing a normal prompt into the composer, e.g. fix the flaky test in dictation_test.go.

Expected behavior

Voice mode shouldn't silently corrupt typed input. Either typing should be blocked/ignored while voice mode is on (it's a modal, mic-driven mode), or the first ordinary printable keypress should exit voice mode and let the user type normally.

Actual behavior

Voice mode only intercepts Space — every other key still goes into the prompt composer as usual. So the user types a whole prompt, all the letters land, and each Space is swallowed by the record gesture instead of inserting a space. The result:

  • The composer fills with run-together text: fixtheflakytestindictation_test.go.
  • Every Space also drives the recorder. On release-reporting terminals each Space is a press/release hold, so it starts and immediately stops a recording; on terminals without release events, Space is press-to-toggle, so alternating spaces start and stop recordings.
  • Those recordings transcribe whatever the mic picked up (room noise, the user talking to themselves, keyboard clatter) and inject it into the same composer, interleaved with the typed characters.

The only signal that voice mode is on is the small 🎙 voice indicator (voiceModeIndicator, internal/tui/dictation.go:606) plus the transient notice that has long since scrolled away — easy to miss, and the failure mode is that the user is well into a prompt before realizing it.

Relevant code:

  • internal/tui/model.go:1624 — Space is claimed for handleVoiceSpacePress while voiceModeEnabled; nothing else in the key path is gated on voice mode, so all other printable keys fall through to the composer.
  • internal/tui/dictation_voice.go — the two-tier press/release gesture.

Relevant logs, screenshots, or error messages

n/a

Metadata

Metadata

Assignees

Labels

issue-approvedReviewed and approved by the core team; community PRs may implement this issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions