20 lines
475 B
Go
Raw Normal View History

2019-06-21 18:02:14 +02:00
// +build linux aix
// +build !appengine
2019-06-21 18:02:14 +02:00
// +build !android
2019-01-08 21:02:11 +01:00
package isatty
import "golang.org/x/sys/unix"
2019-01-08 21:02:11 +01:00
// IsTerminal return true if the file descriptor is terminal.
func IsTerminal(fd uintptr) bool {
_, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
return err == nil
}
// 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
2019-01-08 21:02:11 +01:00
}