You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: review output cannot be captured (writes to /dev/tty) #181
cora review spinner (indicatif::ProgressBar) writes to stderr using \r carriage returns + ANSI escapes. When stdout is piped or redirected, the final formatted output (print!("{}", result.output) in main.rs:556) does go to stdout correctly. The real issue is:
No --output-file flag — no guaranteed way to capture output to a specific file
Spinner not suppressed in non-TTY — indicatif auto-disables in some cases, but create_spinner() in llm.rs:247 and scanner.rs:66 always creates spinners regardless of TTY state
Spinner code duplicated — separate ProgressBar creation in llm.rs and scanner.rs instead of centralized via ProgressReporter
Code References
File
Line
Issue
src/engine/llm.rs
247-257
create_spinner() always creates spinner, no TTY check
src/engine/scanner.rs
66-73
Same — always creates spinner
src/commands/review.rs
271-275
quiet flag skips spinner, but no auto-detect for non-TTY
src/main.rs
556
print!("{}", result.output) — this IS stdout, works correctly
Impact
Severity: Medium (not Critical as originally reported — output does reach stdout)
CI/CD pipelines work fine (GitHub Action captures stdout)
Local batch/scripted usage needs --quiet flag or output is polluted by spinner ANSI
Fix Plan
Add --output-file <PATH> flag to cora review — write formatted output to file (guaranteed capture)
Auto-detect non-TTY stdout → auto-set quiet=true and skip spinner creation
Centralize spinner creation via ProgressReporter instead of duplicating in llm.rs/scanner.rs
Add ProgressBar::draw_target() check — ProgressDrawTarget::stdout() returns hidden when piped
Spinner suppressed in non-TTY — both llm.rs:253 and scanner.rs:69 check stderr().is_terminal() and set ProgressDrawTarget::hidden() when piped/redirected.
--output-file flag — already implemented in main.rs:122 and main.rs:562-566. Writes formatted output to a specified file path.
Spinner code duplication — remaining minor duplication between llm.rs:create_spinner() and scanner.rs inline creation. Low priority cosmetic refactor.
Activity
fix(v0.4.4): output capture + truncated JSON repair (#192)
ajianaz commentedon Jun 7, 2026
All items in this issue have been addressed:
Spinner suppressed in non-TTY — both
llm.rs:253andscanner.rs:69checkstderr().is_terminal()and setProgressDrawTarget::hidden()when piped/redirected.--output-fileflag — already implemented inmain.rs:122andmain.rs:562-566. Writes formatted output to a specified file path.Spinner code duplication — remaining minor duplication between
llm.rs:create_spinner()andscanner.rsinline creation. Low priority cosmetic refactor.