Warning in substr_ctl_internal(x, start = start, stop = stop, type.int = TYPE.INT,  :
  Argument `x` contains a CSI SGR sequence with color codes not supported by terminal at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

substr_ctl("\033[107mA", 1, 1, term.cap = c("all", "bright"))

substr_ctl("\033[107mA", 1, 1, term.cap = c("all", "bright", 
    "old"))

substr_ctl("\033[107mA", 1, 1, term.cap = c("bright"))

substr_ctl("\033[107mA", 1, 1, term.cap = c("bright", "old"))

substr_ctl(str.5, 2, 2, terminate = FALSE, carry = TRUE, term.cap = "all")

substr_ctl(str.5a, 2, 2, terminate = FALSE, carry = TRUE, term.cap = "all")

tryCatch(substr_ctl("\033[38;6;31mworld\033[m", 2, 3), warning = conditionMessage)

Argument `x` contains a CSI SGR sequence with unknown substrings or a OSC hyperlink with unsupported parameters at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

[1] "Argument `x` contains a CSI SGR sequence with unknown substrings or a OSC hyperlink with unsupported parameters at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings."

tryCatch(substr_ctl("\033[31mhello\033[38;5;256m world\033[m", 
    7, 8), warning = conditionMessage)

# illegal colors leave prior color unchanged

[1] "Argument `x` contains a CSI SGR sequence or OSC hyperlink with invalid substrings at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings."

# fraktur and double underline and prop spacing, and other odd ones

tryCatch(substr_ctl("\033[56mworld\033[m", 2, 3), warning = conditionMessage)

tryCatch(substr_ctl("\033[66mworld\033[m", 2, 3), warning = conditionMessage)

tryCatch(substr_ctl("\033[200mworld\033[m", 2, 3), warning = conditionMessage)

hello2.0 <- "\033[42m\thello world\033[m foobar"

substr2_ctl(hello2.0, 1, 2, warn = NULL)

Error in substr2_ctl(hello2.0, 1, 2, warn = NULL) : 
  Argument `warn` must be TRUE or FALSE.

substr2_ctl(hello2.0, 1, 2, tabs.as.spaces = 1)

substr2_ctl(hello2.0, 1, 2, tabs.as.spaces = NA)