From 3953f3ad4f95c6326c76fa1f67a659c5f28c84bf Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 5 Mar 2018 09:36:30 -0800 Subject: [PATCH] Change `||` to `&&` for whether MSYS is a tty The MSYS terminal appears to create pipes with the name `msys-` but *don't* contain `-pty`, so this changes the `||` logic to `&&` to ensure that the logic here doesn't fire for MSYS terminals where piping is used to erroneously diagnose a stdio stream as a tty. Closes #23 --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 379bd94..9112598 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -137,7 +137,7 @@ unsafe fn msys_tty_on(fd: DWORD) -> bool { .as_os_str() .to_string_lossy() .into_owned(); - name.contains("msys-") || name.contains("-pty") + name.contains("msys-") && name.contains("-pty") } /// returns true if this is a tty