From 462fcfbb7264efc5bc3e91ebbfc51e4701ad2944 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 21 Feb 2019 20:57:52 +0100 Subject: [PATCH 1/5] doc: add examples for tty.getColorDepth() env This adds some examples what values can be used to enforce a specific color support in Node.js. --- doc/api/tty.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/api/tty.md b/doc/api/tty.md index 26761442a50865..4ea1773be3b05b 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -165,6 +165,16 @@ to pass in an object with different settings. Use the `NODE_DISABLE_COLORS` environment variable to enforce this function to always return 1. +To enforce a specific color support it's possible to set either one of the +following environment settings. +This rule does not apply to Windows OS, CI environments and some other rare +cases. + +* 2 colors: `NODE_DISABLE_COLORS = 1` +* 16 colors: `TERM = 'console'` +* 256 colors: `TMUX = 1` +* 16,777,216 colors: `TERM_PROGRAM = 'Hyper'` + ### writeStream.getWindowSize()