Problem: ANSI codes are emitted even when output is redirected, unless manually stripped
Why it matters: Logs and files should not contain escape sequences unless explicitly requested.
Proposed solution: On each call, check sys.stdout.isatty() and sys.stderr.isatty(); if false, return plain text unless force_color=True is passed. Update AnsiToWin32 init to respect this flag.
Notes: Preserve existing init(strip=True) for global control; add per-call override for flexibility.
Problem: ANSI codes are emitted even when output is redirected, unless manually stripped
Why it matters: Logs and files should not contain escape sequences unless explicitly requested.
Proposed solution: On each call, check sys.stdout.isatty() and sys.stderr.isatty(); if false, return plain text unless force_color=True is passed. Update AnsiToWin32 init to respect this flag.
Notes: Preserve existing init(strip=True) for global control; add per-call override for flexibility.