is_ansi_tty

0th

Percentile

Detect if a stream support ANSI escape characters

We check that all of the following hold:

  • The stream is a terminal.

  • The platform is Unix.

  • R is not running inside R.app (the macOS GUI).

  • R is not running inside RStudio.

  • R is not running inside Emacs.

  • The terminal is not "dumb".

  • stream is either the standard output or the standard error stream.

Usage
is_ansi_tty(stream = stderr())
Arguments
stream

The stream to check.

Value

TRUE or FALSE.

See Also

Other terminal capabilities: is_dynamic_tty()

Aliases
  • is_ansi_tty
Examples
# NOT RUN {
is_ansi_tty()
# }
Documentation reproduced from package cli, version 2.0.1, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.