Dinesh Belwalkar | e63f7f9 | 2019-11-22 23:11:16 +0000 | [diff] [blame] | 1 | // +build darwin dragonfly freebsd netbsd openbsd |
Scott Baker | 105df15 | 2020-04-13 15:55:14 -0700 | [diff] [blame] | 2 | // +build !js |
Dinesh Belwalkar | e63f7f9 | 2019-11-22 23:11:16 +0000 | [diff] [blame] | 3 | |
4 | package logrus | ||||
5 | |||||
6 | import "golang.org/x/sys/unix" | ||||
7 | |||||
8 | const ioctlReadTermios = unix.TIOCGETA | ||||
9 | |||||
10 | func isTerminal(fd int) bool { | ||||
11 | _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) | ||||
12 | return err == nil | ||||
13 | } |