blob: 3c4f43f91cd1194b1ed1dfe28a6af4cea222ba76 [file] [log] [blame]
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07001// +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