Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add examples for tty.getColorDepth() env #26248

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions doc/api/tty.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
BridgeAR marked this conversation as resolved.
Show resolved Hide resolved
following environment settings.
BridgeAR marked this conversation as resolved.
Show resolved Hide resolved
This rule does not apply to Windows OS, CI environments and some other rare
BridgeAR marked this conversation as resolved.
Show resolved Hide resolved
cases.

* 2 colors: `NODE_DISABLE_COLORS = 1`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works on Windows

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I updated the comment again to reflect that. PTAL.

* 16 colors: `TERM = 'console'`
* 256 colors: `TMUX = 1`
* 16,777,216 colors: `TERM_PROGRAM = 'Hyper'`

### writeStream.getWindowSize()
<!-- YAML
added: v0.7.7
Expand Down