identical(trimws(txt1, which = "left"), trimws_ctl(txt1, which = "left"))

identical(trimws(txt1, which = "right"), trimws_ctl(txt1, which = "right"))

trimws_ctl(txt2, ctl = c("all", "url", "osc"))

Argument `x` contains a non-CSI/OSC escape sequence at index [2], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

Warning in trimws_ctl(txt2, ctl = c("all", "url", "osc")) :
  Argument `x` contains a non-CSI/OSC escape sequence at index [2], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

trimws_ctl(txt2, ctl = c("all", "sgr", "csi"))

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

Warning in trimws_ctl(txt2, ctl = c("all", "sgr", "csi")) :
  Argument `x` contains a non-CSI/OSC escape sequence at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.
Warning in trimws_ctl(txt2, ctl = c("all", "sgr", "csi")) :
  Argument `x` contains a non-CSI/OSC escape sequence at index [2], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

trimws_ctl(" \r\a A \a\t ", ctl = c("all", "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 trimws_ctl(" \r\a A \a\t ", ctl = c("all", "c0")) :
  Argument `x` contains a C0 control character at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

Argument `which` must partial match one of c("both", "left", "right").

Error in trimws_ctl("hello", which = "top") : 
  Argument `which` must partial match one of c("both", "left", "right").

Argument `whitespace` may only be set to "[ \t\r\n]".

Error in trimws_ctl("hello", whitespace = " ") : 
  Argument `whitespace` may only be set to "[ \t\r\n]".