chickadee » chibi-term » ansi-escapes-enabled?

ansi-escapes-enabled? #!optional valueparameter

A parameter object that determines whether ANSI escapes are enabled in some of the preceding procedures. They are disabled if (ansi-escapes-enabled?) returns #f, and otherwise they are enabled.

The initial value returned by (ansi-escapes-enabled?) is determined by the environment.

If the environment variable NO_COLOR is set, the initial value is #f

If the environment variable ANSI_ESCAPES_ENABLED is set, its value determines the initial value returned by (ansi-escapes-enabled?). If the value of ANSI_ESCAPES_ENABLED is "0", the initial value is #f,otherwise the initial value is #t.

If the environment variable ANSI_ESCAPES_ENABLED is not set and the environment variable TERM is set to dumb, the initial value is #f.

If neither of the environment variables NO_COLOR, ANSI_ESCAPES_ENABLED are set and TERM is not dumb, the initial value returned by (ansi-escapes-enabled?) is #t.

Note: The initial value logic has been modifien in the CHICKEN implementation. Chibi's original library did not support NO_COLOR and used a hard-coded list of known TERM values to set the initial value to #t and otherwise default to #f.