Cli colors disappear when piping into a text file

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • color

    Color package for Go (golang)

  • So i have a cli tool thats outputting some text to the cli stdout, i would like the output to be colored, so i used a library called color (github.com/fatih/color), basically the problem is when i output to stdout its fine but when i do something like ./tool | tee -a file.txt the colors disappear from terminal and also not in the output file, why is that and how do i prevent that ?

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts