Added FreeBSD support

This commit is contained in:
2025-02-16 17:28:10 +01:00
parent 9f6283216c
commit 1ef7d85db5
4 changed files with 14 additions and 0 deletions

11
tty/Terminal_bsd.go Normal file
View File

@ -0,0 +1,11 @@
//go:build darwin || freebsd
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
}