blob: 499789984d2bf6ed56218d551d8f9f4c17d918e3 [file] [log] [blame]
khenaidood948f772021-08-11 17:49:24 -04001// +build darwin dragonfly freebsd netbsd openbsd
2// +build !js
3
4package logrus
5
6import "golang.org/x/sys/unix"
7
8const ioctlReadTermios = unix.TIOCGETA
9
10func isTerminal(fd int) bool {
11 _, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
12 return err == nil
13}