# Intermediate byte (this is not an SGR!); tryCatch due to inconsistency
# on whether call is included in condition message

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

substr_sgr("\033[55;38l\033[31mhello world", 2, 4, warn = FALSE)

# non-SGR CSI mixed with SGR when not parsing non-SGR CSI

substr_sgr("\033[31m\033[55;38lhello world", 2, 4, warn = FALSE)

substr_sgr("hello \033[31m\033[55;38lworld", 7, 9, warn = FALSE)

substr_ctl("\033[55;38l\033[31mhello world", 2, 4, warn = FALSE)

substr_ctl("\033[31m\033[55;38lhello world", 2, 4, warn = FALSE)

substr_ctl("hello \033[31m\033[55;38lworld", 7, 9, warn = FALSE)

substr_ctl("hello\033[55;38l \033[31mworld", 4, 7, warn = FALSE)

substr_sgr("ab\n\tcd\n", 3, 6, warn = FALSE)

substr_sgr("ab\n\033[31m\tcd\n", 3, 6, warn = FALSE)

substr_ctl("ab\n\033[31m\tcd\n", 3, 6, warn = FALSE, ctl = c("all", 
    "nl"))

substr_ctl("ab\n\033[31m\tcd\n", 3, 6, warn = FALSE, ctl = c("all", 
    "nl", "c0"))

Argument `x` contains a C0 control character at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

Warning in substr_ctl_internal(x, start = start, stop = stop, type.int = TYPE.INT,  :
  Argument `x` contains a C0 control character at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

Argument `x` contains a C0 control character at index [2], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

Warning in substr_ctl_internal(x, start = start, stop = stop, type.int = TYPE.INT,  :
  Argument `x` contains a C0 control character at index [2], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

Argument `x` contains a C0 control character at index [3], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

Warning in substr_ctl_internal(x, start = start, stop = stop, type.int = TYPE.INT,  :
  Argument `x` contains a C0 control character at index [3], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.