common/terminal: Enable color output on windows

Closes #8209
This commit is contained in:
Joe Mooring
2025-06-08 16:48:49 -07:00
committed by Bjørn Erik Pedersen
parent fad57964aa
commit 4217fee4b0

View File

@@ -17,7 +17,6 @@ package terminal
import (
"fmt"
"os"
"runtime"
"strings"
isatty "github.com/mattn/go-isatty"
@@ -41,10 +40,6 @@ func PrintANSIColors(f *os.File) bool {
// 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))
}