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

View File

@ -16,3 +16,9 @@ func IsTerminal(fd uintptr) bool {
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
return err == 0
}
// 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
}