2021-08-26 17:01:35 +00:00
|
|
|
// +build linux aix zos
|
2021-06-26 01:40:38 +00:00
|
|
|
// +build !js
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|