Or maybe use getOption("width"), but at least it should use the terminal width, even if the console is a proper terminal.
From @DavisVaughan
EDIT: this seems to be a problem in Positron only, because Positron has
``` r
options(width = 100)
isatty(stdin())
```
## [1] TRUE
``` r
cli::is_ansi_tty()
```
## [1] TRUE