blob: 3c4f43f91cd1194b1ed1dfe28a6af4cea222ba76 [file] [log] [blame]
Dinesh Belwalkare63f7f92019-11-22 23:11:16 +00001// +build darwin dragonfly freebsd netbsd openbsd
2
3package logrus
4
5import "golang.org/x/sys/unix"
6
7const ioctlReadTermios = unix.TIOCGETA
8
9func isTerminal(fd int) bool {
10 _, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
11 return err == nil
12}
13