From c67de43ff3221ae5554398095261d684b6d41dda Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 15 Nov 2023 14:10:12 +0900 Subject: fix(runtime): fix Deno.noColor when stdout is not tty (#21208) --- runtime/ops/bootstrap.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'runtime/ops') diff --git a/runtime/ops/bootstrap.rs b/runtime/ops/bootstrap.rs index 1b86a7509..72e31a1d6 100644 --- a/runtime/ops/bootstrap.rs +++ b/runtime/ops/bootstrap.rs @@ -15,6 +15,7 @@ deno_core::extension!( op_bootstrap_language, op_bootstrap_log_level, op_bootstrap_no_color, + op_bootstrap_is_tty, ], ); @@ -57,5 +58,11 @@ pub fn op_bootstrap_log_level(state: &mut OpState) -> i32 { #[op2(fast)] pub fn op_bootstrap_no_color(state: &mut OpState) -> bool { let options = state.borrow::(); - options.no_color || !options.is_tty + options.no_color +} + +#[op2(fast)] +pub fn op_bootstrap_is_tty(state: &mut OpState) -> bool { + let options = state.borrow::(); + options.is_tty } -- cgit v1.2.3