diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2023-11-15 14:10:12 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 14:10:12 +0900 |
commit | c67de43ff3221ae5554398095261d684b6d41dda (patch) | |
tree | 7ffe8fddeb575b3203787745845ab99acb883cff /runtime/ops/bootstrap.rs | |
parent | 4913274a6508a5e5ad6c8babf2e90a4a84bf98ec (diff) |
fix(runtime): fix Deno.noColor when stdout is not tty (#21208)
Diffstat (limited to 'runtime/ops/bootstrap.rs')
-rw-r--r-- | runtime/ops/bootstrap.rs | 9 |
1 files changed, 8 insertions, 1 deletions
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::<BootstrapOptions>(); - 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::<BootstrapOptions>(); + options.is_tty } |