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.
has_ctl(x, which = "all", warn = getOption("fansi.warn"))has_sgr(x, warn = getOption("fansi.warn"))
a character vector or object that can be coerced to character.
character, what Control Sequences to check for; see strip
parameter for strip_ctl for details.
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).
logical of same length as x
; NA values in x
result in NA values
in return
fansi for details on how Control Sequences are interpreted, particularly if you are getting unexpected results.