Skip to content

Commit

Permalink
Merge pull request #61 from fatih/fix-windows
Browse files Browse the repository at this point in the history
Fix coloring on cygwin/msys2 shell
  • Loading branch information
fatih authored Feb 17, 2017
2 parents 3ffb804 + 11bf3cb commit 7824417
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion color.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ var (
// false or true based on the stdout's file descriptor referring to a terminal
// or not. This is a global option and affects all colors. For more control
// over each color block use the methods DisableColor() individually.
NoColor = !isatty.IsTerminal(os.Stdout.Fd()) || os.Getenv("TERM") == "dumb"
NoColor = os.Getenv("TERM") == "dumb" ||
(!isatty.IsTerminal(os.Stdout.Fd()) && !isatty.IsCygwinTerminal(os.Stdout.Fd()))

// Output defines the standard output of the print functions. By default
// os.Stdout is used.
Expand Down

0 comments on commit 7824417

Please sign in to comment.