Files
faketunes/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go
Vladimir Hodakov 13ac06c14b Initial commit
Proof-of-concept implementation. Bugs will occur.
2026-02-12 01:18:46 +03:00

14 lines
264 B
Go

// +build darwin dragonfly freebsd netbsd openbsd hurd
// +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
}