10 const ioctlReadTermios = syscall.TCGETS
12 // IsTerminal return true if the file descriptor is terminal.
13 func IsTerminal(fd uintptr) bool {
14 var termios syscall.Termios
15 _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
19 // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
20 // terminal. This is also always false on this environment.
21 func IsCygwinTerminal(fd uintptr) bool {