Files
LearnGO/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/terminal_check_solaris.go
T
2024-09-19 21:38:24 -04:00

12 lines
224 B
Go

package logrus
import (
"golang.org/x/sys/unix"
)
// IsTerminal returns true if the given file descriptor is a terminal.
func isTerminal(fd int) bool {
_, err := unix.IoctlGetTermio(fd, unix.TCGETA)
return err == nil
}