From: Lorenz Cuno Klopfenstein Date: Fri, 2 Nov 2018 08:09:02 +0000 (+0100) Subject: Fix ANSI character output regression on Windows X-Git-Tag: v0.51~24 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b8725f518;p=brevno-suite%2Fhugo Fix ANSI character output regression on Windows Fixes #5377 --- diff --git a/common/terminal/colors.go b/common/terminal/colors.go index a02d016d..334b82fa 100644 --- a/common/terminal/colors.go +++ b/common/terminal/colors.go @@ -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)) }