2023-03-20 11:16:08 +01:00
|
|
|
//go:build darwin
|
|
|
|
// +build darwin
|
|
|
|
|
|
|
|
package terminal
|
|
|
|
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
|
|
|
|
const ioctlReadTermios = unix.TIOCGETA
|
2023-03-21 15:53:53 +01:00
|
|
|
|
|
|
|
func isTerminal(fd int) bool {
|
|
|
|
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
|
|
|
|
return err == nil
|
|
|
|
}
|