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

23
vendor/github.com/mattn/go-isatty/isatty_android.go generated vendored Normal file
View File

@ -0,0 +1,23 @@
// +build android
package isatty
import (
"syscall"
"unsafe"
)
const ioctlReadTermios = syscall.TCGETS
// IsTerminal return true if the file descriptor is terminal.
func IsTerminal(fd uintptr) bool {
var termios syscall.Termios
_, _, 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
}