state_no_arg <- function(x) {
    fansi:::VAL_IN_ENV(x = x, warn = TRUE, term.cap = "all", 
        ctl = "all", carry = TRUE)
    tcw(tce(.Call(fansi:::FANSI_state_at_end, x, WARN.INT, TERM.CAP.INT, 
        CTL.INT, TRUE, carry, NA_character_, FALSE)))
}

# test warnings/errors without arg specified

Encountered a malformed UTF-8 sequence at index [1], see `?unhandled_ctl`.

[1] "Encountered a malformed UTF-8 sequence at index [1], see `?unhandled_ctl`."

Encountered 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.

[1] "Encountered 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."