2019-03-26 23:53:49 +03:00
|
|
|
// +build darwin dragonfly freebsd netbsd openbsd
|
2019-09-19 12:06:10 +03:00
|
|
|
// +build !js
|
2019-03-26 23:53:49 +03:00
|
|
|
|
2019-04-01 19:16:11 +03:00
|
|
|
package logrus
|
2019-03-26 23:53:49 +03:00
|
|
|
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
|
|
|
|
const ioctlReadTermios = unix.TIOCGETA
|
|
|
|
|
2019-04-01 19:16:11 +03:00
|
|
|
func isTerminal(fd int) bool {
|
2019-03-26 23:53:49 +03:00
|
|
|
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
|
|
|
|
return err == nil
|
|
|
|
}
|