Skip to content

Commit

Permalink
Use stdout.isTTY instead of tty.isatty
Browse files Browse the repository at this point in the history
  • Loading branch information
iamandrewluca committed Mar 20, 2024
1 parent 0928e67 commit 5074622
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import * as tty from "tty"

const {
env = {},
argv = [],
platform = "",
stdout = {},
} = typeof process === "undefined" ? {} : process

const isDisabled = "NO_COLOR" in env || argv.includes("--no-color")
const isForced = "FORCE_COLOR" in env || argv.includes("--color")
const isWindows = platform === "win32"
const isDumbTerminal = env.TERM === "dumb"

const isCompatibleTerminal =
tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal
const isCompatibleTerminal = stdout.isTTY && env.TERM && !isDumbTerminal

const isCI =
"CI" in env &&
Expand Down

0 comments on commit 5074622

Please sign in to comment.