Added more tests
This commit is contained in:
parent
71c74c800b
commit
e0bfa137d5
10 changed files with 91 additions and 55 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue