Files
noscomptes-back/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go
2021-11-03 14:10:58 +01:00

15 lines
331 B
Go

//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && !js
// +build darwin dragonfly freebsd netbsd openbsd
// +build !js
package logrus
import "golang.org/x/sys/unix"
const ioctlReadTermios = unix.TIOCGETA
func isTerminal(fd int) bool {
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
return err == nil
}