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.
stream
is_ansi_tty(stream = stderr())
The stream to check.
TRUE or FALSE.
TRUE
FALSE
Other terminal capabilities: is_dynamic_tty()
is_dynamic_tty()
# NOT RUN { is_ansi_tty() # }
Run the code above in your browser using DataLab