Skip to content

Commit 066c219

Browse files
committed
fix: Replace atty with is_terminal
1 parent 4db5e87 commit 066c219

File tree

3 files changed

+140
-15
lines changed

3 files changed

+140
-15
lines changed

Cargo.lock

+134-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pre-release-replacements = [
3939
[features]
4040
default = ["auto-color", "humantime", "regex"]
4141
color = ["dep:termcolor"]
42-
auto-color = ["dep:atty", "color"]
42+
auto-color = ["dep:is-terminal", "color"]
4343
humantime = ["dep:humantime"]
4444
regex = ["dep:regex"]
4545

@@ -48,7 +48,7 @@ log = { version = "0.4.8", features = ["std"] }
4848
regex = { version = "1.0.3", optional = true, default-features=false, features=["std", "perf"] }
4949
termcolor = { version = "1.1.1", optional = true }
5050
humantime = { version = "2.0.0", optional = true }
51-
atty = { version = "0.2.5", optional = true }
51+
is-terminal = { version = "0.4.0", optional = true }
5252

5353
[[test]]
5454
name = "regexp_filter"

src/fmt/writer/atty.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ printed.
88

99
#[cfg(feature = "auto-color")]
1010
mod imp {
11+
use is_terminal::IsTerminal;
12+
1113
pub(in crate::fmt) fn is_stdout() -> bool {
12-
atty::is(atty::Stream::Stdout)
14+
std::io::stdout().is_terminal()
1315
}
1416

1517
pub(in crate::fmt) fn is_stderr() -> bool {
16-
atty::is(atty::Stream::Stderr)
18+
std::io::stderr().is_terminal()
1719
}
1820
}
1921

0 commit comments

Comments
 (0)