fansi (version 0.3.0)

term_cap_test: Test Terminal Capabilities

Description

Outputs ANSI CSI SGR formatted text to screen so that you may visually inspect what color capabilities your terminal supports. The three tested terminal capabilities are:

Usage

term_cap_test()

Arguments

Value

character the test vector, invisibly

Details

  • "bright" for bright colors with SGR codes in 90-97 and 100-107

  • "256" for colors defined by "38;5;x" and "48;5;x" where x is in 0-255

  • "truecolor" for colors defined by "38;2;x;y;z" and "48;x;y;x" where x, y, and z are in 0-255

Each of the color capabilities your terminal supports should be displayed with a blue background and a red foreground. For reference the corresponding CSI SGR sequences are displayed as well.

You should compare the screen output from this function to getOption('fansi.term.cap') to ensure that they are self consistent.

By default fansi assumes terminals support bright and 256 color modes, and also tests for truecolor support via the $COLORTERM system variable.

See Also

fansi for details on how Control Sequences are interpreted, particularly if you are getting unexpected results.

Examples

Run this code
# NOT RUN {
term_cap_test()
# }

Run the code above in your browser using DataLab