fix: removed colorization on non-tty

Fixes a bug whereby `cheat` would apply ANSI colorization even when
outputting into a non-TTY.
This commit is contained in:
Chris Lane
2019-10-29 19:47:56 -04:00
parent 10af84dc10
commit 33ac3d34d1
242 changed files with 55375 additions and 13277 deletions

22
vendor/github.com/mattn/go-isatty/isatty_plan9.go generated vendored Normal file
View File

@ -0,0 +1,22 @@
// +build plan9
package isatty
import (
"syscall"
)
// IsTerminal returns true if the given file descriptor is a terminal.
func IsTerminal(fd uintptr) bool {
path, err := syscall.Fd2path(fd)
if err != nil {
return false
}
return path == "/dev/cons" || path == "/mnt/term/dev/cons"
}
// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
// terminal. This is also always false on this environment.
func IsCygwinTerminal(fd uintptr) bool {
return false
}