Description
When using the voice capture feature (Ctrl + V), two main issues occur:
- UI Refresh Bug: After speaking, the transcribed text is added to
stdinInput, but renderInput() is not called and activeFooter status is not cleared. This leaves the "Recording..." popup visible and hides the transcribed text until extra keypresses force a UI re-render.
- Linux/Node Process Management: On Linux/Node runtime,
ffmpeg doesn't exit cleanly with SIGKILL/SIGTERM during voice capture, leading to empty/corrupted audio files or hanging processes. Switching to SIGINT allows ffmpeg to finalize the WAV header properly.
Steps to Reproduce
- Press
Ctrl + V to start recording.
- Speak a phrase and press
Ctrl + V (or Enter) to stop.
- Observe that the footer status message remains stuck on "Recording..." and the text does not appear in the input prompt immediately.
Suggested Fixes / Code Context
In startVoiceCapture() / input event handler:
- UI Reset & Render: Ensure
activeFooter.setStatusMessage("") is called in the finally block or on success, followed by renderInput() after setting stdinInput so the transcribed text is displayed right away.
- Process Termination: Send
SIGINT instead of SIGTERM/SIGKILL to the ffmpeg spawned process so it cleanly stops recording and flushes the WAV file headers before transcription.
- Platform Agnostic Audio: Fallback gracefully when
avfoundation or Bun.file are not available in non-macOS or non-Bun environments.
Environment
- OS: Linux (CachyOS / Arch)
- Audio Subsystem: PipeWire / PulseAudio
Opened on behalf of @YounessTaki0.
Description
When using the voice capture feature (
Ctrl + V), two main issues occur:stdinInput, butrenderInput()is not called andactiveFooterstatus is not cleared. This leaves the "Recording..." popup visible and hides the transcribed text until extra keypresses force a UI re-render.ffmpegdoesn't exit cleanly withSIGKILL/SIGTERMduring voice capture, leading to empty/corrupted audio files or hanging processes. Switching toSIGINTallowsffmpegto finalize the WAV header properly.Steps to Reproduce
Ctrl + Vto start recording.Ctrl + V(or Enter) to stop.Suggested Fixes / Code Context
In
startVoiceCapture()/ input event handler:activeFooter.setStatusMessage("")is called in thefinallyblock or on success, followed byrenderInput()after settingstdinInputso the transcribed text is displayed right away.SIGINTinstead ofSIGTERM/SIGKILLto theffmpegspawned process so it cleanly stops recording and flushes the WAV file headers before transcription.avfoundationorBun.fileare not available in non-macOS or non-Bun environments.Environment
Opened on behalf of @YounessTaki0.