File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ pub fn stderr_isatty() -> bool {
4
4
isatty ( libc:: STDERR_FILENO )
5
5
}
6
6
7
- // FIXME: Unfortunately this doesn't detect msys terminals so rustup
8
- // is always colorless there (just like rustc and cargo).
9
7
#[ cfg( windows) ]
10
8
pub fn stderr_isatty ( ) -> bool {
11
9
isatty ( winapi:: um:: winbase:: STD_ERROR_HANDLE )
@@ -30,6 +28,11 @@ fn isatty(fd: libc::c_int) -> bool {
30
28
#[ inline]
31
29
#[ cfg( windows) ]
32
30
fn isatty ( fd : winapi:: shared:: minwindef:: DWORD ) -> bool {
31
+ if std:: env:: var ( "MSYSTEM" ) . is_ok ( ) {
32
+ // FIXME: No color is better than broken color codes in MSYS shells
33
+ // https://github.com/rust-lang/rustup/issues/2292
34
+ return false ;
35
+ }
33
36
use winapi:: um:: { consoleapi:: GetConsoleMode , processenv:: GetStdHandle } ;
34
37
unsafe {
35
38
let handle = GetStdHandle ( fd) ;
You can’t perform that action at this time.
0 commit comments