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 259B

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