diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-07-31 22:06:18 -0700 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-08-04 20:41:19 -0700 |
commit | 5f0ef50077002f0308fc45f7d0a01a508c970516 (patch) | |
tree | a0aecc6edf4298d0f168da350eccab2cbb716391 /doc | |
parent | 378ec5fb0611e314511a7afc806664205846fc2e (diff) |
cli: eat terminal codes from stdout also
This *should* be sound, plus or minus the amount that the terminal code
eating code is messed up already.
This is useful for testing CLI output because it will strip the escapes
enough to just shove the expected output in a file.
Change-Id: I8a9b58fafb918466ac76e9ab585fc32fb9294819
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual/rl-next/clicolor-clarity.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/manual/rl-next/clicolor-clarity.md b/doc/manual/rl-next/clicolor-clarity.md new file mode 100644 index 000000000..8a289e362 --- /dev/null +++ b/doc/manual/rl-next/clicolor-clarity.md @@ -0,0 +1,26 @@ +--- +synopsis: "Better usage of colour control environment variables" +cls: [1699, 1702] +credits: [jade] +category: Improvements +--- + +Lix now heeds `NO_COLOR`/`NOCOLOR` for more output types, such as that used in `nix search`, `nix flake metadata` and similar. + +It also now supports `CLICOLOR_FORCE`/`FORCE_COLOR` to force colours regardless of whether there is a terminal on the other side. + +It now follows rules compatible with those described on <https://bixense.com/clicolors/> with `CLICOLOR` defaulted to enabled. + +That is to say, the following procedure is followed in order: +- NO_COLOR or NOCOLOR set + + Always disable colour +- CLICOLOR_FORCE or FORCE_COLOR set + + Enable colour +- The output is a tty; TERM != "dumb" + + Enable colour +- Otherwise + + Disable colour |