Skip to content

Commit c6c65ba

Browse files
Migrate crayon::has_color() -> cli::num_ansi_colors()>1 (#1809)
Closes #1808
1 parent 6d08312 commit c6c65ba

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/rlang/session.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bool r_is_installed(const char* pkg) {
1515
static r_obj* has_colour_call = NULL;
1616

1717
bool r_has_colour(void) {
18-
if (!r_is_installed("crayon")) {
18+
if (!r_is_installed("cli")) {
1919
return false;
2020
}
2121

@@ -26,7 +26,7 @@ void r_init_library_session(void) {
2626
is_installed_call = r_parse("requireNamespace(x, quietly = TRUE)");
2727
r_preserve(is_installed_call);
2828

29-
has_colour_call = r_parse("crayon::has_color()");
29+
has_colour_call = r_parse("cli::num_ansi_colors() > 1L");
3030
r_preserve(has_colour_call);
3131
}
3232

0 commit comments

Comments
 (0)