mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-30 07:40:06 +01:00
13 lines
237 B
Go
13 lines
237 B
Go
//go:build darwin || freebsd || openbsd
|
|
|
|
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
|
|
}
|