Added more tests

This commit is contained in:
Eduard Urbach 2024-03-12 15:23:08 +01:00
parent 71c74c800b
commit e0bfa137d5
Signed by: eduard
GPG key ID: 49226B848C78F6C8
10 changed files with 91 additions and 55 deletions

View file

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