Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorLorenz Cuno Klopfenstein <lck@klopfenstein.net>2018-11-02 11:09:02 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-11-02 11:09:02 +0300
commitb8725f5181f6a2709274a82c1c3fdfd8f2e3e28c (patch)
treebf829c04f854a80a8ca556019de7334fd3aed7ae /common
parent0bc4b0246dd6b7d71f8676a52644077a4f70ec8f (diff)
Fix ANSI character output regression on Windows
Fixes #5377
Diffstat (limited to 'common')
-rw-r--r--common/terminal/colors.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/terminal/colors.go b/common/terminal/colors.go
index a02d016d9..334b82fae 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))
}