summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2023-02-01 16:17:09 +0100
committerLinus Färnstrand <linus@mullvad.net>2023-02-01 16:17:09 +0100
commitc646045b9f25e31be377096db91db0f7907510d3 (patch)
tree7bf326e4d27a27bfaca11bc5f5df42c6191ce6bd
parent5b362bf29afac944751a480f21b5e86c10a4fdeb (diff)
parent46b01641478dacb9375800ef520f08fec69a0eb6 (diff)
downloadmullvadvpn-c646045b9f25e31be377096db91db0f7907510d3.tar.xz
mullvadvpn-c646045b9f25e31be377096db91db0f7907510d3.zip
Merge branch 'replace-atty'
-rw-r--r--Cargo.lock3
-rw-r--r--talpid-core/Cargo.toml1
-rw-r--r--talpid-openvpn/Cargo.toml2
-rw-r--r--talpid-openvpn/src/process/openvpn.rs7
4 files changed, 6 insertions, 7 deletions
diff --git a/Cargo.lock b/Cargo.lock
index cd2a877280..64a2080e5d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3134,7 +3134,6 @@ name = "talpid-core"
version = "0.0.0"
dependencies = [
"async-trait",
- "atty",
"bitflags",
"byteorder",
"cfg-if",
@@ -3215,13 +3214,13 @@ name = "talpid-openvpn"
version = "0.0.0"
dependencies = [
"async-trait",
- "atty",
"bitflags",
"byteorder",
"cfg-if",
"duct",
"err-derive",
"futures",
+ "is-terminal",
"lazy_static",
"log",
"os_pipe",
diff --git a/talpid-core/Cargo.toml b/talpid-core/Cargo.toml
index f74fe7db33..d8b8a6ab82 100644
--- a/talpid-core/Cargo.toml
+++ b/talpid-core/Cargo.toml
@@ -35,7 +35,6 @@ tokio = { version = "1.8", features = ["process", "rt-multi-thread", "fs"] }
rand = "0.8.5"
[target.'cfg(not(target_os="android"))'.dependencies]
-atty = "0.2"
byteorder = "1"
internet-checksum = "0.2"
shadowsocks-service = { version = "1.14.3", default-features = false, features = ["local", "stream-cipher"] }
diff --git a/talpid-openvpn/Cargo.toml b/talpid-openvpn/Cargo.toml
index 9f96252abf..ed20600243 100644
--- a/talpid-openvpn/Cargo.toml
+++ b/talpid-openvpn/Cargo.toml
@@ -11,11 +11,11 @@ publish = false
[dependencies]
bitflags = "1.2"
async-trait = "0.1"
-atty = "0.2"
cfg-if = "1.0"
duct = "0.13"
err-derive = "0.3.1"
futures = "0.3.15"
+is-terminal = "0.4.2"
lazy_static = "1.0"
log = "0.4"
os_pipe = "0.9"
diff --git a/talpid-openvpn/src/process/openvpn.rs b/talpid-openvpn/src/process/openvpn.rs
index 4b8932ee13..6a62ee3171 100644
--- a/talpid-openvpn/src/process/openvpn.rs
+++ b/talpid-openvpn/src/process/openvpn.rs
@@ -1,7 +1,6 @@
use duct;
use super::stoppable_process::StoppableProcess;
-use atty;
use os_pipe::{pipe, PipeWriter};
use parking_lot::Mutex;
use shell_escape;
@@ -388,11 +387,13 @@ pub struct OpenVpnProcHandle {
impl OpenVpnProcHandle {
/// Constructor for a new openvpn proc handle
pub fn new(mut cmd: duct::Expression) -> io::Result<Self> {
- if !atty::is(atty::Stream::Stdout) {
+ use is_terminal::IsTerminal;
+
+ if !std::io::stdout().is_terminal() {
cmd = cmd.stdout_null();
}
- if !atty::is(atty::Stream::Stderr) {
+ if !std::io::stderr().is_terminal() {
cmd = cmd.stderr_null();
}