Added FreeBSD support

This commit is contained in:
Eduard Urbach 2025-02-16 17:28:10 +01:00
parent 77b109b517
commit cb8aacf9b8
Signed by: eduard
GPG key ID: 49226B848C78F6C8
4 changed files with 14 additions and 0 deletions

View file

@ -1,9 +0,0 @@
package tty
import "golang.org/x/sys/unix"
// IsTerminal returns true if the file descriptor is a terminal.
func IsTerminal(fd uintptr) bool {
_, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA)
return err == nil
}