Check if the RStudio console supports ANSI color escapes.

hasColorConsole()

Value

TRUE if ANSI color escapes are supported; FALSE otherwise.

Note

The hasColorConsole function was added in version 1.1.216 of RStudio.

Examples


if (FALSE) {
if (rstudioapi::hasColorConsole()) {
  message("RStudio console supports ANSI color sequences.")
}

}