1 // +build darwin freebsd openbsd netbsd dragonfly
11 const ioctlReadTermios = syscall.TIOCGETA
13 // IsTerminal return true if the file descriptor is terminal.
14 func IsTerminal(fd uintptr) bool {
15 var termios syscall.Termios
16 _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
20 // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
21 // terminal. This is also always false on this environment.
22 func IsCygwinTerminal(fd uintptr) bool {