Skip to content

fix(cli): disable ANSI colors for redirected output by default - #6

Merged
LucasYanzy merged 2 commits into
LucasXlab:mainfrom
slophisticated:fix/auto-terminal-color
Oct 24, 2026
Merged

LucasYanzy merged 2 commits into
LucasXlab:mainfrom
slophisticated:fix/auto-terminal-color

Conversation

@slophisticated

Copy link
Copy Markdown
Contributor

Closes #4.

Redirecting the terminal summary currently writes ANSI escape sequences into files and CI logs. The renderer now detects sys.stdout.isatty() when no color preference is supplied. --color forces ANSI output and the existing --no-color disables it; argparse treats the two overrides as mutually exclusive. The README documents this behavior. Runtime dependencies remain empty.

Validation on Windows with Python 3.14.7:

  • python -m pytest -q: all 20 tests passed.
  • Added six capsys cases covering TTY/non-TTY output with default, --color, and --no-color. Three cases fail against the original implementation.
  • Verified actual subprocess stdout pipes: default output contains no ANSI escapes, while --color retains them.
  • git diff --check passed.

@LucasYanzy
LucasYanzy merged commit f7f23ee into LucasXlab:main Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color-free fallback auto-detect

2 participants