Skip to content

Commit

Permalink
Fix coloring on cygwin/msys2 shell
Browse files Browse the repository at this point in the history
Closes #57
  • Loading branch information
fatih committed Feb 17, 2017
1 parent 3ffb804 commit 11bf3cb
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 11bf3cb

Please sign in to comment.