2021-09-02 10:03:56 +00:00
|
|
|
// +build linux aix zos
|
|
|
|
// +build !js
|
2020-01-04 13:36:39 +00:00
|
|
|
|
|
|
|
package logrus
|
|
|
|
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
|
|
|
|
const ioctlReadTermios = unix.TCGETS
|
|
|
|
|
|
|
|
func isTerminal(fd int) bool {
|
|
|
|
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
|
|
|
|
return err == nil
|
|
|
|
}
|