Skip to content

Update terminal environment variables to detect colors #27609

Closed
@BridgeAR

Description

@BridgeAR

Right now we have a pretty decent list of environment variables to detect different terminals that support colors. However, it is often not exactly known from what version on these terminals actually support the colors, if that's detectable and how many colors these support.

I would like to start a list of different terminals / CIs and other things including their corresponding environment variables or other information to detect these and the information how many colors they support.

The current code can be found here: https://github.com/nodejs/node/blob/master/lib/internal/tty.js

A lot of information about terminals that support 16 million colors can be found here: https://github.com/termstandard/colors

Anyone can please check their terminal and post the name, version, corresponding env settings (not all) and the supported colors. This should be pretty straight forward and a good first contribution! The more information we gather here, the better Node.js will become in properly supporting colors.

Just enter the following in your terminal to check for true color:

printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n"

Update: Please make sure you check what environment variables are set by your terminal! That is important since not all correspond to $TERM but some also to e.g., $TERM_PROGRAM. You can check what environment variables are set by running: node -e 'console.log(process.env)'. You have to check what environment variables correspond to the terminal. Please do not post any environment variables besides those.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that are suitable for first-time contributors.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.ttyIssues and PRs related to the tty subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions