force_no_colour

Function force_no_colour 

Source
pub fn force_no_colour() -> Result<(), AlreadySet>
Expand description

Do not inject ANSI colour escape codes into the output, regardless of the value of the CLICOLOR_FORCE environment variable, or whether the output terminal (if any) supports them.

This should normally only be called by a binary application, not a library. It should be called before using any of the print or write macros.

ยงErrors

Returns an error if this library has already been initialised to inject ANSI colour escape codes, e.g. by calling force_colour of calling one of the macros where the environment was detected to require coloured output.