blob: 499789984d2bf6ed56218d551d8f9f4c17d918e3 [file] [log] [blame]
Dinesh Belwalkare63f7f92019-11-22 23:11:16 +00001// +build darwin dragonfly freebsd netbsd openbsd
Scott Baker105df152020-04-13 15:55:14 -07002// +build !js
Dinesh Belwalkare63f7f92019-11-22 23:11:16 +00003
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}