ralph-claude-code/lib
Frank Bria 05c57207f3
fix(wizard): redirect prompts to stderr for clean command substitution (#130)
When wizard prompt functions (prompt_text, prompt_number, select_option,
select_with_default) were used with command substitution, ANSI-colored
prompts were captured along with user responses, corrupting .ralphrc
values like: PROJECT_NAME="[0;36mProject name[0m [value]: value"

Fix:
- Redirect all display output (colored prompts, validation messages) to
  stderr using >&2, matching the pattern already used by select_multiple()
- Keep only the actual response/result on stdout for command substitution

Changes:
- lib/wizard_utils.sh: Add >&2 to prompt_text (lines 84-87),
  prompt_number (lines 118-121, 131-151), confirm (lines 44, 60),
  select_option (lines 190-215), select_with_default (lines 330-364)
- tests/unit/test_wizard_utils.bats: Add 20 new tests for stdout/stderr
  separation and clean command substitution results
- CLAUDE.md: Update test count to 420

Test count: 420 (up from 396)

Co-authored-by: Test User <test@example.com>
2026-01-26 14:47:06 -07:00
..
circuit_breaker.sh feat(structure): migrate Ralph files to .ralph/ subfolder (#109) 2026-01-20 23:22:30 -07:00
date_utils.sh feat(analyzer): add Claude CLI JSON format support and session management 2026-01-09 17:46:02 -07:00
enable_core.sh feat(enable): add ralph-enable wizard for existing projects (v0.11.0) (#124) 2026-01-25 14:37:25 -07:00
response_analyzer.sh Merge main and apply code review fixes 2026-01-21 21:42:29 -07:00
task_sources.sh feat(enable): add ralph-enable wizard for existing projects (v0.11.0) (#124) 2026-01-25 14:37:25 -07:00
timeout_utils.sh Add timeout command support for macOS (#108) 2026-01-20 18:40:21 -07:00
wizard_utils.sh fix(wizard): redirect prompts to stderr for clean command substitution (#130) 2026-01-26 14:47:06 -07:00