No_color: Disabling Ansi Color Output by Default
Posted3 months agoActive3 months ago
no-color.orgTechstory
calmmixed
Debate
60/100
Ansi Color OutputTerminal UIStandardization
Key topics
Ansi Color Output
Terminal UI
Standardization
The 'No Color' initiative proposes disabling ANSI color output by default using the NO_COLOR environment variable, sparking discussion on its implications and existing practices in various software and terminals.
Snapshot generated from the HN discussion
Discussion Activity
Active discussionFirst comment
53m
Peak period
12
96-108h
Avg / period
3.8
Comment distribution15 data points
Loading chart...
Based on 15 loaded comments
Key moments
- 01Story posted
Oct 3, 2025 at 4:56 AM EDT
3 months ago
Step 01 - 02First comment
Oct 3, 2025 at 5:48 AM EDT
53m after posting
Step 02 - 03Peak activity
12 comments in 96-108h
Hottest window of the conversation
Step 03 - 04Latest activity
Oct 9, 2025 at 3:20 AM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45460656Type: storyLast synced: 11/20/2025, 2:33:22 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
Though most of the software do the right thing by checking if the standard output is an actual tty (isatty) to avoid colors when redirecting to something else (e.g. socket, fifo, etc).
The name NO_COLOR suggests a really binary choice which may be okay. Though GNU coreutils usually have a more selective option like --color=always|auto|never.
I'd prefer supporting a more general COLORS=on|off|compatible|...
Meaning:
- on: always on even when redirecting
- off: fully off
- compatible: maybe something like on by default and off if redirecting to a non-tty
- ...: add more choices
At least I do. :)
This is a very questionable heuristic. I'm not sure the exact date that support began, but I have been piping color output to `less -r/-R` for decades. This can be nice even for less than multi-terminal-page output just for "search".
isatty(stderr) would actually be more accurate for my specific use cases for when I don't `|&` or maybe even `isatty(stdin)`, but those are also imperfect heuristics.
The point is, since "auto" is a questionable heuristic, it is not so crazy/wrong to just default to color-on and have an off switch and that off switch is what NO_COLOR is about (as explained by the very first sentence in the linked article). Desirable defaults ultimately depend upon the distribution of your user's tastes (as always, more|less).
NO_COLOR is orthogonal to the isatty suppression.
NO_COLOR ensures that colors are off even when stdout is not redirected.
For example, when you have poor vision, poor quality display, or sit near a window, (or worse – a combination of these) the colored parts of the output might have lower contrast, low enough to make them impossible to read.
It seems that different software handles that question in different ways.
had no effect yet
It would be good to unify it, perhaps some of the distributions can also have a hand in it.
terminfo also has "Mono mode" with the "-m" suffix which I don't see mentioned in the article.
I see a lot of handing of color options in the standard Ubuntu .bashrc https://gist.github.com/marioBonales/1637696