Fix ANSI character output regression on Windows
authorLorenz Cuno Klopfenstein <lck@klopfenstein.net>
Fri, 2 Nov 2018 08:09:02 +0000 (09:09 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 2 Nov 2018 08:09:02 +0000 (09:09 +0100)
Fixes #5377

common/terminal/colors.go

index a02d016d9837af9f803d1b519e5fa3e963129cbb..334b82fae5b4f6ba17a08b20abe36832fac0033e 100644 (file)
@@ -17,6 +17,7 @@ package terminal
 import (
        "fmt"
        "os"
+       "runtime"
        "strings"
 
        isatty "github.com/mattn/go-isatty"
@@ -31,6 +32,10 @@ const (
 // IsTerminal return true if the file descriptor is terminal and the TERM
 // environment variable isn't a dumb one.
 func IsTerminal(f *os.File) bool {
+       if runtime.GOOS == "windows" {
+               return false
+       }
+
        fd := f.Fd()
        return os.Getenv("TERM") != "dumb" && (isatty.IsTerminal(fd) || isatty.IsCygwinTerminal(fd))
 }