github cloudposse/atmos v1.215.0-rc.1

pre-release3 hours ago

🚀 Enhancements

fix: provenance and syntax highlighting respect --no-color and pipe detection @osterman (#2281) ## what
  • Provenance output (describe component --provenance) now strips ANSI color codes when stdout is piped or redirected, and respects --no-color
  • Syntax highlighting via HighlightCodeWithConfig also properly degrades when stdout is piped
  • Provenance output now routes through data.Write() instead of fmt.Print() for proper I/O channel handling

why

  • Provenance rendering used lipgloss.NewStyle() unconditionally without checking stdout TTY status, so ANSI escape codes leaked into piped/redirected output
  • HighlightCodeWithConfig checked IsTTYSupportForStdout() || IsTTYSupportForStderr() — since stderr remains a TTY when piping stdout, this always returned true and defeated pipe detection
  • fmt.Print() bypassed the data channel I/O layer, skipping secret masking

references

  • Follows the same stdout-only TTY check pattern used by list commands (pkg/list/list_values.go)
  • Mirrors HighlightCodeWithConfig's precedence: NoColor wins, then ForceColor, then stdout TTY detection

Summary by CodeRabbit

  • Improvements

    • More precise color handling for provenance and code highlighting: honors NoColor/ForceColor and now detects stdout TTY only for consistent styling.
    • Provenance rendering disables styling when color is off.
    • Provenance stdout output now flows through the shared output path for more consistent display.
  • Bug Fixes

    • Normalized spacing and newline placement around provenance legends and stack headers.
  • Tests

    • Updated/added tests and golden snapshots to reflect whitespace, legend formatting, and color/no-color behaviors.

Don't miss a new atmos release

NewReleases is sending notifications on new releases.