fansi (version 0.3.0)

has_ctl: Checks for Presence of Control Sequences

Description

has_ctl checks for any Control Sequence, whereas has_sgr checks only for ANSI CSI SGR sequences. You can check for different types of sequences with the which parameter.

Usage

has_ctl(x, which = "all", warn = getOption("fansi.warn"))

has_sgr(x, warn = getOption("fansi.warn"))

Arguments

x

a character vector or object that can be coerced to character.

which

character, what Control Sequences to check for; see strip parameter for strip_ctl for details.

warn

TRUE (default) or FALSE, whether to warn when potentially problematic Control Sequences are encountered. These could cause the assumptions fansi makes about how strings are rendered on your display to be incorrect, for example by moving the cursor (see fansi).

Value

logical of same length as x; NA values in x result in NA values in return

See Also

fansi for details on how Control Sequences are interpreted, particularly if you are getting unexpected results.