terminal_check_solaris.go 224 B

1234567891011
  1. package logrus
  2. import (
  3. "golang.org/x/sys/unix"
  4. )
  5. // IsTerminal returns true if the given file descriptor is a terminal.
  6. func isTerminal(fd int) bool {
  7. _, err := unix.IoctlGetTermio(fd, unix.TCGETA)
  8. return err == nil
  9. }