2019-04-22 20:57:35 +08:00
|
|
|
// +build darwin dragonfly freebsd netbsd openbsd
|
2020-03-25 01:50:15 +08:00
|
|
|
// +build !js
|
2019-04-22 20:57:35 +08:00
|
|
|
|
|
|
|
package logrus
|
|
|
|
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
|
|
|
|
const ioctlReadTermios = unix.TIOCGETA
|
|
|
|
|
|
|
|
func isTerminal(fd int) bool {
|
|
|
|
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
|
|
|
|
return err == nil
|
|
|
|
}
|