VictoriaMetrics/app/vmctl/terminal/unix_bsd.go
2023-03-21 09:26:26 -07:00

14 lines
232 B
Go

//go:build darwin
// +build darwin
package terminal
import "golang.org/x/sys/unix"
const ioctlReadTermios = unix.TIOCGETA
func isTerminal(fd int) bool {
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
return err == nil
}