Skip to content

Commit fc0385e

Browse files
committed
Use std IsTerminal interface
1 parent 1754da3 commit fc0385e

File tree

3 files changed

+3
-43
lines changed

3 files changed

+3
-43
lines changed

src/currentprocess.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::cell::RefCell;
22
use std::env;
33
use std::ffi::OsString;
44
use std::fmt::Debug;
5-
use std::io;
5+
use std::io::{self, IsTerminal};
66
use std::panic;
77
use std::path::PathBuf;
88
use std::sync::Once;
@@ -31,8 +31,6 @@ use cwdsource::*;
3131
use filesource::*;
3232
use varsource::*;
3333

34-
use crate::utils::tty::{stderr_isatty, stdout_isatty};
35-
3634
/// An abstraction for the current process.
3735
///
3836
/// This acts as a clonable proxy to the global state provided by some key OS
@@ -186,8 +184,8 @@ pub struct OSProcess {
186184
impl OSProcess {
187185
pub fn new() -> Self {
188186
OSProcess {
189-
stderr_is_a_tty: stderr_isatty(),
190-
stdout_is_a_tty: stdout_isatty(),
187+
stderr_is_a_tty: io::stderr().is_terminal(),
188+
stdout_is_a_tty: io::stdout().is_terminal(),
191189
}
192190
}
193191
}

src/utils/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
pub(crate) mod notifications;
33
pub mod raw;
44
pub(crate) mod toml_utils;
5-
pub(crate) mod tty;
65
pub(crate) mod units;
76
#[allow(clippy::module_inception)]
87
pub mod utils;

src/utils/tty.rs

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)