nchar_ctl("\033]hello \033\\world", ctl = c("all", "osc"))

# but don't support OSC (interpret as 2 char ESC)

Warning in nchar_ctl_internal(x = x, type.int = TYPE.INT, allowNA = allowNA,  :
  Argument `x` contains a malformed CSI or OSC sequence at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.