2019-06-20 05:39:19 +00:00
|
|
|
// +build linux aix
|
2020-08-24 10:13:46 +00:00
|
|
|
// +build !js
|
2019-06-20 05:39:19 +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
|
|
|
|
}
|