diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2024-05-14 17:32:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-14 17:32:09 -0400 |
| commit | e39b94f3aa09bc77280b98caebb9ae472f8f6c5a (patch) | |
| tree | 8bfaec53de64cd6dcfccf2045f4231265b091fdd /runtime/worker_bootstrap.rs | |
| parent | 1e2b0a22196ab2a17ceae855293fdcd5a2596161 (diff) | |
fix(runtime): output to stderr with colors if a tty and stdout is piped (#23813)
This also fixes a bug where Deno would output to stderr with colours
when piped and stdout was not piped.
Diffstat (limited to 'runtime/worker_bootstrap.rs')
| -rw-r--r-- | runtime/worker_bootstrap.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/worker_bootstrap.rs b/runtime/worker_bootstrap.rs index 31cb883db..e1abf87fc 100644 --- a/runtime/worker_bootstrap.rs +++ b/runtime/worker_bootstrap.rs @@ -76,7 +76,8 @@ pub struct BootstrapOptions { pub location: Option<ModuleSpecifier>, /// Sets `Deno.noColor` in JS runtime. pub no_color: bool, - pub is_tty: bool, + pub is_stdout_tty: bool, + pub is_stderr_tty: bool, // --unstable flag, deprecated pub unstable: bool, // --unstable-* flags @@ -109,7 +110,8 @@ impl Default for BootstrapOptions { user_agent, cpu_count, no_color: !colors::use_color(), - is_tty: deno_terminal::is_stdout_tty(), + is_stdout_tty: deno_terminal::is_stdout_tty(), + is_stderr_tty: deno_terminal::is_stderr_tty(), enable_op_summary_metrics: Default::default(), enable_testing_features: Default::default(), log_level: Default::default(), |
