7 import "golang.org/x/sys/unix"
9 // IsTerminal return true if the file descriptor is terminal.
10 func IsTerminal(fd uintptr) bool {
11 _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
15 // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
16 // terminal. This is also always false on this environment.
17 func IsCygwinTerminal(fd uintptr) bool {