[BUG] Voice mode: unhandled stderr from internal subprocess corrupts TUI rendering

Resolved 💬 1 comment Opened Mar 13, 2026 by carrotRakko Closed Mar 21, 2026

What's Wrong?

When voice mode is active and Space is held to record, ALSA error messages from the internal audio subprocess (SoX/rec) are written directly to stderr, which shares the same terminal device as the TUI. These unhandled stderr writes corrupt the TUI layout — raw error text renders over the Ink-managed display, breaking the visual presentation.

This happens because the internal rec process's stderr is not captured or redirected. Unlike the Bash tool (which properly captures subprocess stderr and renders it within the TUI), voice mode lets its subprocess's stderr flow directly to the terminal.

What Should Happen?

stderr output from voice mode's internal subprocess (rec) should be captured and either:

  • Suppressed silently (since the errors are non-fatal ALSA warnings)
  • Rendered within the TUI as a diagnostic message
  • Redirected to a log file

The TUI should never be corrupted by unhandled stderr from internal subprocesses.

Error Messages/Logs

ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default

These errors repeat on every push-to-talk cycle and render directly over the TUI, producing a garbled display.

Steps to Reproduce

  1. Run Claude Code inside any Docker container (including the official devcontainer) with no audio hardware
  2. Install SoX: sudo apt-get install -y sox
  3. Enable voice mode: /voice
  4. Hold Space to record
  5. ALSA errors flood the terminal, rendering over the TUI layout

Note: The underlying trigger is libasound writing to stderr when no audio device is available. This is common in Docker/devcontainer environments but could occur with any library that writes to stderr in the voice mode subprocess chain.

Is this a regression?

I don't know

Claude Code Version

2.1.74

Additional Information

The core issue is not Docker-specific — it's that voice mode does not handle stderr from its internal processes. ALSA in a container without audio hardware is just one way to trigger it; any library writing to stderr in the rec process chain would produce the same TUI corruption.

For comparison, the Bash tool properly captures subprocess stderr and renders it as styled output within the TUI. Voice mode lacks this handling.

Related issues (different symptoms, same feature):

  • #33607 — push-to-talk flicker due to key repeat
  • #30293 — "No speech detected" errors

✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)

View original on GitHub ↗

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