You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

terminal_check_bsd.go 246B

12345678910111213
  1. // +build darwin dragonfly freebsd netbsd openbsd
  2. package logrus
  3. import "golang.org/x/sys/unix"
  4. const ioctlReadTermios = unix.TIOCGETA
  5. func isTerminal(fd int) bool {
  6. _, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
  7. return err == nil
  8. }