frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

No_color: Disabling ANSI color output by default

https://no-color.org/
53•agvxov•4mo ago

Comments

openmarkand•4mo ago
Hmm, why not.

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

sudahtigabulan•4mo ago
> 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).

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.

cb321•4mo ago
> do the right thing by checking if the standard output is an actual tty (isatty)

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).

yjftsjthsd-h•4mo ago
Yeah, my first thought on seeing this was that I really want a way to force color just as easily; when I output diffs in CI, they're much more readable with color but it's a pain to enable it when running headless.
bhaak•4mo ago
I'd argue that if somebody implements NO_COLOR support they will likely also implement a --color switch to force color.

At least I do. :)

blueflow•4mo ago
Neither "curses" nor "ncurses" are mentioned on the page - that would be the traditional place to implement such behavior. terminfo still has xterm and xterm-color separately, so this functionality used to exist ($TERM based, tho) before go and rust.
antonyh•4mo ago
Maven has the `-B` option, but that has the side effect of working in a no-input mode so it's not ideal. There's plenty of times I'd like to have it working interactively but without the ANSI colour codes.
lukasgelbmann•4mo ago
Does NO_COLOR=1 mean that all ANSI formatting should be disabled? Including bold text, italic text, and so on?

It seems that different software handles that question in different ways.

willm•4mo ago
I asked the author a while back. They said it purely relates to colour. Not other styles. Alas, they removed the issues and there is no record of that.
trashb•4mo ago
Isn't there already a lot of separate implementations around color handling?

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

post_on_hn•4mo ago
No, we need OS-wide setting to also change light mode and dark mode across GUI/TUI/console without restarting applications.
singularity2001•4mo ago
export NO_COLOR=1

had no effect yet

aiiizzz•4mo ago
The terminal _really_ sucks for UI. I wish it was better
esseph•4mo ago
I couldn't disagree more.
lowlevel•4mo ago
I have been disabling colour for 30 years… and it’s always a pain in the butt. Glad to see this acknowledged at least.

Ask HN: How are researchers using AlphaFold in 2026?

1•jocho12•2m ago•0 comments

Running the "Reflections on Trusting Trust" Compiler

https://spawn-queue.acm.org/doi/10.1145/3786614
1•devooops•6m ago•0 comments

Watermark API – $0.01/image, 10x cheaper than Cloudinary

https://api-production-caa8.up.railway.app/docs
1•lembergs•8m ago•1 comments

Now send your marketing campaigns directly from ChatGPT

https://www.mail-o-mail.com/
1•avallark•12m ago•1 comments

Queueing Theory v2: DORA metrics, queue-of-queues, chi-alpha-beta-sigma notation

https://github.com/joelparkerhenderson/queueing-theory
1•jph•24m ago•0 comments

Show HN: Hibana – choreography-first protocol safety for Rust

https://hibanaworks.dev/
5•o8vm•25m ago•0 comments

Haniri: A live autonomous world where AI agents survive or collapse

https://www.haniri.com
1•donangrey•26m ago•1 comments

GPT-5.3-Codex System Card [pdf]

https://cdn.openai.com/pdf/23eca107-a9b1-4d2c-b156-7deb4fbc697c/GPT-5-3-Codex-System-Card-02.pdf
1•tosh•39m ago•0 comments

Atlas: Manage your database schema as code

https://github.com/ariga/atlas
1•quectophoton•42m ago•0 comments

Geist Pixel

https://vercel.com/blog/introducing-geist-pixel
2•helloplanets•45m ago•0 comments

Show HN: MCP to get latest dependency package and tool versions

https://github.com/MShekow/package-version-check-mcp
1•mshekow•52m ago•0 comments

The better you get at something, the harder it becomes to do

https://seekingtrust.substack.com/p/improving-at-writing-made-me-almost
2•FinnLobsien•54m ago•0 comments

Show HN: WP Float – Archive WordPress blogs to free static hosting

https://wpfloat.netlify.app/
1•zizoulegrande•56m ago•0 comments

Show HN: I Hacked My Family's Meal Planning with an App

https://mealjar.app
1•melvinzammit•56m ago•0 comments

Sony BMG copy protection rootkit scandal

https://en.wikipedia.org/wiki/Sony_BMG_copy_protection_rootkit_scandal
2•basilikum•58m ago•0 comments

The Future of Systems

https://novlabs.ai/mission/
2•tekbog•59m ago•1 comments

NASA now allowing astronauts to bring their smartphones on space missions

https://twitter.com/NASAAdmin/status/2019259382962307393
2•gbugniot•1h ago•0 comments

Claude Code Is the Inflection Point

https://newsletter.semianalysis.com/p/claude-code-is-the-inflection-point
3•throwaw12•1h ago•1 comments

Show HN: MicroClaw – Agentic AI Assistant for Telegram, Built in Rust

https://github.com/microclaw/microclaw
1•everettjf•1h ago•2 comments

Show HN: Omni-BLAS – 4x faster matrix multiplication via Monte Carlo sampling

https://github.com/AleatorAI/OMNI-BLAS
1•LowSpecEng•1h ago•1 comments

The AI-Ready Software Developer: Conclusion – Same Game, Different Dice

https://codemanship.wordpress.com/2026/01/05/the-ai-ready-software-developer-conclusion-same-game...
1•lifeisstillgood•1h ago•0 comments

AI Agent Automates Google Stock Analysis from Financial Reports

https://pardusai.org/view/54c6646b9e273bbe103b76256a91a7f30da624062a8a6eeb16febfe403efd078
1•JasonHEIN•1h ago•0 comments

Voxtral Realtime 4B Pure C Implementation

https://github.com/antirez/voxtral.c
2•andreabat•1h ago•1 comments

I Was Trapped in Chinese Mafia Crypto Slavery [video]

https://www.youtube.com/watch?v=zOcNaWmmn0A
2•mgh2•1h ago•1 comments

U.S. CBP Reported Employee Arrests (FY2020 – FYTD)

https://www.cbp.gov/newsroom/stats/reported-employee-arrests
1•ludicrousdispla•1h ago•0 comments

Show HN: I built a free UCP checker – see if AI agents can find your store

https://ucphub.ai/ucp-store-check/
2•vladeta•1h ago•1 comments

Show HN: SVGV – A Real-Time Vector Video Format for Budget Hardware

https://github.com/thealidev/VectorVision-SVGV
1•thealidev•1h ago•0 comments

Study of 150 developers shows AI generated code no harder to maintain long term

https://www.youtube.com/watch?v=b9EbCb5A408
2•lifeisstillgood•1h ago•0 comments

Spotify now requires premium accounts for developer mode API access

https://www.neowin.net/news/spotify-now-requires-premium-accounts-for-developer-mode-api-access/
2•bundie•1h ago•0 comments

When Albert Einstein Moved to Princeton

https://twitter.com/Math_files/status/2020017485815456224
1•keepamovin•1h ago•0 comments