Error in strwrap2_ctl(x = x, width = width, indent = indent, exdent = exdent,  : 
  Argument `carry` must be scalar.

Error in strwrap2_ctl(wrp.0, 20, carry = 1) : 
  Argument `carry` must be logical or character.

Error in strwrap2_ctl(x = x, width = width, indent = indent, exdent = exdent,  : 
  Argument `carry` must be logical or character.

## leading SGR consumed and merged with carry

substr_ctl(str.0, 2, 5, terminate = FALSE)

substr_sgr(str.0, 2, 5, terminate = FALSE)

substr2_ctl(str.0, 2, 5, terminate = FALSE)

substr2_sgr(str.0, 2, 5, terminate = FALSE)

strwrap_ctl(wrp.0, 20, terminate = FALSE)

[1] "once upon \033[44ma time in" "a land far away"            
[3] "over"                        "the mountains and"          
[5] "\033[7msea lived a fair"     "creature"                   
[7] "with \033[4mdark itentions"  "and a yappy dog."

strwrap_sgr(wrp.0, 20, terminate = FALSE)

strwrap2_ctl(wrp.0, 20, terminate = FALSE)

strwrap2_sgr(wrp.0, 20, terminate = FALSE)

strtrim_ctl(wrp.0, 20, terminate = FALSE)

[1] "once upon \033[44ma time in " "the mountains and \033[7m s" 
[3] "with \033[4mdark itentions "

strtrim_sgr(wrp.0, 20, terminate = FALSE)

strtrim2_ctl(wrp.0, 20, terminate = FALSE)

strtrim2_sgr(wrp.0, 20, terminate = FALSE)

Argument `terminate` must be TRUE or FALSE

Error in strtrim2_ctl(x = x, width = width, warn = warn, tabs.as.spaces = tabs.as.spaces,  : 
  Argument `terminate` must be TRUE or FALSE

fansi:::bridge("\033[42m", "\033[31m", normalize = TRUE)

`substr_ctl<-`(txt, 2, 2, value = "?", normalize = TRUE, carry = TRUE)

state_at_end(x, carry = TRUE, normalize = TRUE)

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.

Warning in state_at_end("a\033[pb") :
  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.

state_at_end(c("\033[42mA", NA_character_, "\033[31mA"), carry = TRUE)

Warning in close_state("a\033[pb") :
  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.