mirror of
https://github.com/hanzoai/metrics.git
synced 2026-10-30 20:03:39 +00:00
13 lines
237 B
Go
13 lines
237 B
Go
//go:build aix || linux || solaris || zos
|
|
|
|
package terminal
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
const ioctlReadTermios = unix.TCGETS
|
|
|
|
func isTerminal(fd int) bool {
|
|
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
|
|
return err == nil
|
|
}
|