Skip to content

Conversation

@ink-splatters
Copy link
Contributor

@ink-splatters ink-splatters commented Dec 8, 2025

Previously, color output was unconditionally controlled by the --no-color flag, overwriting fatih/color's automatic TTY detection. This caused ANSI escape codes to appear in redirected/piped output, violating UNIX conventions.

Changes:

  • Add internal/colors package centralizing color handling
  • Only override auto-detection when --color or --no-color explicitly set
  • Let fatih/color's isatty detection work by default
  • Consolidate color constructors to avoid duplication across packages

Closes #971

@ink-splatters ink-splatters changed the title fix(color): respect TTY detection for ANSI color output (closes #971) fix(color): respect TTY detection for ANSI color output Dec 9, 2025
@ink-splatters ink-splatters force-pushed the fix/color-tty-detection branch 4 times, most recently from 5baca27 to b9fcd0b Compare December 24, 2025 11:36
Changes:
- Add internal/colors package centralizing color handling
- Only override auto-detection when --color or --no-color explicitly
  set, letting fatih/color's isatty detection do its job
- Consolidate color constructors to avoid duplication across packages

Signed-off-by: Peter A. <ink.splatters@pm.me>
@ink-splatters ink-splatters force-pushed the fix/color-tty-detection branch from b9fcd0b to 02f2032 Compare December 28, 2025 16:12
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 output doesn't get autodetected

1 participant