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/js | |
parent | 4913274a6508a5e5ad6c8babf2e90a4a84bf98ec (diff) |
fix(runtime): fix Deno.noColor when stdout is not tty (#21208)
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/99_main.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 06a7d605d..76a279bbd 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -241,7 +241,7 @@ function opMainModule() { const opArgs = memoizeLazy(() => ops.op_bootstrap_args()); const opPid = memoizeLazy(() => ops.op_bootstrap_pid()); const opPpid = memoizeLazy(() => ops.op_ppid()); -setNoColorFn(() => ops.op_bootstrap_no_color()); +setNoColorFn(() => ops.op_bootstrap_no_color() || !ops.op_bootstrap_is_tty()); function formatException(error) { if (ObjectPrototypeIsPrototypeOf(ErrorPrototype, error)) { @@ -530,7 +530,7 @@ function bootstrapMainRuntime(runtimeOptions) { ObjectDefineProperties(finalDenoNs, { pid: util.getterOnly(opPid), ppid: util.getterOnly(opPpid), - noColor: util.getterOnly(getNoColor), + noColor: util.getterOnly(() => ops.op_bootstrap_no_color()), args: util.getterOnly(opArgs), mainModule: util.getterOnly(opMainModule), }); @@ -666,7 +666,7 @@ function bootstrapWorkerRuntime( } ObjectDefineProperties(finalDenoNs, { pid: util.getterOnly(opPid), - noColor: util.getterOnly(getNoColor), + noColor: util.getterOnly(() => ops.op_bootstrap_no_color()), args: util.getterOnly(opArgs), }); // Setup `Deno` global - we're actually overriding already |