Last updated: 2023-05-06

An increasing number of command-line software programs output text with
ANSI color
escape codes by default.
While some developers and users obviously prefer seeing these colors,
some users don’t.
Unfortunately, every new piece of software seems to have a
different way
of disabling colored text output and some software has no way at all.

Accepting the futility of trying to reverse this trend in 2017, an informal
standard was proposed:

Command-line software which adds ANSI color to its output by default should
check for a NO_COLOR environment variable that, when present and not an empty
string (regardless of its value), prevents the addition of ANSI color.

By adopting this standard, users that prefer to have plain, non-colored text
output can export NO_COLOR=1 to their shell’s environment and automatically
disable color by default in all supported software.

If your software outputs color by default, please consider not doing so.
If you insist, please implement this standard to make it easy for your
users to disable color and then add your software to this list by
submitting a pull request.

If your software does not output color by default, you do not need to bother
with this standard.

Example Implementation

#include 
#include 
#include 

int
main(int argc, char *argv[])
{
	char *no_color = getenv("NO_COLOR");
	bool color = true;

	if (no_color != NULL && no_color[0] != '')
		color = false;

	/* do getopt(3) and/or config-file parsing to possibly turn color back on */
	...
}

Frequently Asked Questions

  1. Why not just set $TERM to dumb or xterm without color support?
    Or change all color definitions in the terminal to print the same color?

    The terminal is capable of color and should be able to print color when
    instructed.
    NO_COLOR is a hint to the software running in the terminal to suppress
    addition of color, not to the terminal to prevent any color from being
    shown.

    It is reasonable to configure certain software such as a text editor to use
    color or other ANSI attributes sparingly (such as the reverse attribute for
    a status bar) while still desiring that other software not add color unless
    configured to.
    It should be up to the user whether color is used, not the software author.

  2. How should configuration files and command-line arguments be processed
    in the presence of $NO_COLOR?

    User-level configuration files and per-instance command-line arguments
    should override $NO_COLOR.
    A user should be able to export $NO_COLOR in their shell configuration
    file as a default, but configure a specific program in its configuration
    file to specifically enable color.

    This also means that software that can add color but doesn’t by default
    does not need to care about $NO_COLOR, because it will only ever be
    adding color when instructed to do so (as it should be).

Color libraries supporting NO_COLOR to disable default color output

Software using these libraries to output color inherently support disabling
color by default via NO_COLOR.

Software directly supporting NO_COLOR to disable color output by default

Software Description Date / Version Supported
alogview Android logcat Filter 2018-10-31
Ammonite Scala Scripting 2017-07-03 / 1.0.0
Ansible IT automation system 2021-04-26 / 2.11.0
Ansible Navigator IT automation interface 2021-10-13 / 1.1.0
Apt Debian Package manager 2021-10-10 / 2.3.11
Archey 4 Python system information tool 2020-09-26 / 4.8.0
Arduino CLI Arduino command line tool 2021-09-02 / 0.19.0
Aurornis A library to simplify command line programs testing 2021-11-16 / 1.2.0
Bashly Bash command line framework and CLI generator 2021-10-26 / 0.6.9
bat A cat(1) clone with syntax highlighting and Git integration 2020-10-02 / 0.16.0
beets Music library manager and MusicBrainz tagger 2019-05-30 / 1.4.9
bfs Breadth-first version of the UNIX find command 2019-05-06 / 1.4.1
Bikeshed Spec/Document Processor 2018-07-27 / 0.9
Bloop Compilation/test server for Scala and Java 2018-07-02 / 1.5.3
buildkit Concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit 2022-07-20
Bullseye A .NET library for running a target dependency graph 2021-01-01 / 3.6.0
c-ray The small C raytracer 2021-09-24
Cake A cross-platform build automation system with a C# DSL 2021-03-06 / 1.1.0
CakePHP Full stack framework for PHP 2019-12-30 / 4.0.1
cdist Usable configuration management 2020-06-17 / 6.6.0
checkit File integrity tool for Linux and Unix systems. 2022-09-08 / 0.5.1
chezmoi Manage dotfiles across multiple machines, securely 2020-05-06 / 1.8.1
CliFM The command line file manager 2021-14-12 / 1.7
Clipboard The cut, copy, and paste system for the terminal 2022-12-04 / 0.1.2
Cras Cras: The Anti-Procrastination Tool 2020-06-05 / 0.1.0
Cronie Cronie cron daemon project 2021-03-19 / 1.6.1
csv2db CSV database loading tool 2019-09-23 / 1.4.0
DataLad Data management and publication multitool 2019-05-23 / 0.11.5
DDraceNetwork Cooperative multiplayer game 2022-02-27 / 5.1
debian-subsystem Use Debian subsystem on other GNU/Linux distributions with desktop integration 2021-11-09
DeepfakeHTTP Web server that uses HTTP dumps as a source for responses 2021-09-17 / 1.0.13
deno Secure TypeScript runtime 2019-02-09 / 0.2.11
Diun Docker Image Update Notifier 2021-05-26 / 4.17.0
elfinfo Utility for displaying ELF information 2020-01-17 / 1.0.1
Elixir Dynamic, functional language 2020-01-27 / 1.10.0
enum4linux-ng Next generation enum4linux (Windows/Samba enumeration tool) 2020-10-24 / 1.1.0
exa A modern replacement for ls 2021-12-06
F2 Safe and fast cross-platform bulk-rename tool 2021-05-04 / 1.5.7
fastlane The easiest way to build and release mobile apps 2020-11-19 / 2.168.0
fd Simple, fast, and user-friendly alternative to find 2020-03-22 / 7.5.0
ffind Rust utility to find files and folders 2018-03-24
forest-arborist Manage a loosely coupled forest of git or hg repositories 2018-04-15 / 1.2.0
fselect Utility for finding files with SQL-like expressions 2019-03-08 / 0.6.1
gatsby-cli GatsbyJS command line interface 2019-08-05 / 2.20.0
git-delete-merged-branches Command-line tool to delete merged Git branches 2020-06-29 / 1.2.0
git-subline-merge Git merge driver for resolving conflicts 2019-07-27
GitHub CLI CLI for GitHub to manage pull requests, issues, and others 2020-09-16 / 1.0.0
gocryptfs Encrypted FUSE filesystem 2021-12-11 / 2.3
gopass Password store for teams 2018-06-06 / 1.8.0
gplaces A simple terminal based Gemini client 2022-06-05 / 0.16.19
gwen Automation and robotics for Gherkin 2021-11-16 / 3.0.0
Hajime Advanced Minecraft server wrapper 2022-02-27
Homebrew Package manager for macOS 2018-02-27 / 1.5.5
Hspec Testing framework for Haskell 2021-05-12 / 1.8.1
htmltest Tests generated HTML for issues 2021-01-16 / 0.14.0
Hugo Framework for building websites 2022-06-16 / 0.101.0
Hurl Run and test HTTP requests with plain text and curl 2022-09-13 / 1.7.0
hx Futuristic take on hexdump, made in Rust 2020-11-22 / 0.4.0
inary A package manager for SulinOS 2021-10-18
irb Official Ruby REPL 2021-06-21 / 1.3.6
jc Convert the output of popular command-line tools and file-types to JSON 2021-12-07 / 1.17.4
jello Filter JSON and JSON Lines data with Python syntax 2021-12-08 / 1.5.0
KBSecret Secret manager backed by Keybase and KBFS 2018-04-13 / 1.4.0
kitten Tiny multi-server automation tool 2018-06-06 / 0.2.14
konch Python shell/REPL configuration tool 2019-01-19 / 4.0.0
lat Fast file viewer and text formatter 2023-04-20 / 0.3.2
lbt Friendly tools for interacting with the LBRY network 2022-03-31 / 2.1.2
lc Multi-dimensional, abbreviating ls/file lister in Nim 2019-11-18 / 0.9.1
LicensePlist License list generator for Apple developer 2022-09-20 / 3.23.3
Lintian Friendly packaging advice for Debian contributors 2021-12-12 / 2.114.87
lr File list generator 2018-01-29 / 1.5.1
lsd The next gen ls command 2022-01-16 / 0.21.0
mblaze Unix utilities to deal with Maildir 2018-01-29 / 1.2
meli Terminal mail client in Rust 2019-01-27 / 0.7.2
Meltano Data Ingestion, Transformation, and Management for Data Engineers 2022-11-08 / v2.9.0
Middleman Ruby-based static site generator 2019-02-18 / 5.0.0
mmCEsim Millimeter Wave Channel Estimation Simulation 2023-03-31 / 0.2.1
Modules Dynamic modification of one’s environment 2020-04-07 / 4.5.0
mu Maildir indexer/searcher 2019-02-02 / 1.8.10
Nette Tester Testing library for PHP 2020-08-03 / 2.3.3
newsraft Feed reader for terminal 2022-08-14 / 0.8
NGLess Domain specific language for bioinformatics 2018-10-29 / 1.5.0
Nix The purely functional package manager 2021-11-01 / 2.4.0
nnn File manager 2020-04-05 / 4.6
npm Package manager for JavaScript 2018-03-24 / 5.8.0
nvh Node Version Helper 2018-08-04 / 4.1.0
o Small, fast, and limited text editor 2020-01-06 / 2.13.2
OCaml compiler The OCaml programming language compiler 2022-03-28 / 4.14.0
Octopus Deploy CLI Command Line Interface for Octopus Deploy 2022-11-23 / 0.6.0
opass Offer password suggestions 2021-06-12 / 0.9.1
ouch Painless CLI compression and decompression 2021-09-17 / 0.3.1
Pacstall An AUR-inspired package manager for Ubuntu 2023-02-27 / 3.7.0
picocli Tiny Java command line interface 2019-01-05 / 3.9.0
pipewire PipeWire multimedia server 2021-03-13 / 0.3.24
Planck Stand-alone ClojureScript REPL 2019-05-19 / 2.23.0
procs Process and system query and formatting 2019-11-18 / 0.4.0
pulumi Programming-language-based IaC framework 2018-06-04 / 0.14.3
PyDERASN Python ASN.1 DER/CER/BER library 2018-02-14 / 3.1
pytest Python testing framework 2020-07-28 / 6.0.0
ripgrep Line-oriented search tool 2020-01-11 / 12.0.0
rsmodules Manage one’s environment by the use of modulefiles 2018-10-09 / 0.7.3
Ruff An extremely fast Python linter, written in Rust 2023-08-09
Scipion CryoEM and CryoET image processing workflow engine 2022-07-07 / 3.0.22
ShellSpec A full-featured BDD unit testing framework for shell scripts 2020-06-21 / 0.25.0
shuffle Command line music player 2022-02-03 / 1.9.1
sjasmplus Z80/Z80N/GameBoy cross-assembler 2022-06-14 / 1.20.0
smenu Terminal selection filter 2018-02-05 / 1.0.0
Snow Testing library for C 2018-01-24 / 2.3.2
soupault Static website generator based on HTML rewriting 2021-07-19 / 3.0.0
sqlfmt Autoformatter for dbt SQL 2021-11-05 / 0.1.0
Symfony PHP framework and reusable components 2019-11-21 / 4.4.0
taoup Fortune implementation 2018-09-10 / 1.19
Tarantool In-memory computing platform 2021-10-19
TeaISO Live ISO generation tools for Debian, Arch Linux, Tearch and Sulin 2021-10-22
tealdeer TLDR pages client 2020-09-03 / 1.4.0
Telescope Gemini browser 2021-06-27 / 0.3
tree A recursive directory listing command 2022-12-26 / 2.1.0
twa Tiny web auditor with strong opinions 2018-11-15 / 1.1.0
txtnish Twtxt microblogging client 2018-08-31
undertime Timezone coordination tool 2018-06-06
whence Print URL a file was downloaded from 2020-06-20 / 0.9.2
woob Command-line applications to interact with many websites (banking, weather, video, etc.) 2021-05-13 / 3.1
xh Friendly and fast tool for sending HTTP requests 2021-02-28 / 0.8.0
xidoc A consistent and powerful markup language 2023-01-09 / 2023.1.9
xplr File manager 2021-04-15 / 0.4.4
zf A commandline fuzzy finder that prioritizes matches on filenames 2022-07-02 / 0.5
zoxide A smarter cd command 2020-03-05 / 0.1.0

Disabling color in software not supporting NO_COLOR

Read More