terminal_solaris.go 217 B

12345678910
  1. package term
  2. import "golang.org/x/sys/unix"
  3. // IsTty returns true if the given file descriptor is a terminal.
  4. func IsTty(fd uintptr) bool {
  5. _, err := unix.IoctlGetTermios(int(fd), unix.TCGETA)
  6. return err == nil
  7. }