2017-02-01 00:45:59 +00:00
|
|
|
// +build solaris,!appengine
|
2016-07-20 09:46:01 +00:00
|
|
|
|
|
|
|
package logrus
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"golang.org/x/sys/unix"
|
|
|
|
)
|
|
|
|
|
|
|
|
// IsTerminal returns true if the given file descriptor is a terminal.
|
|
|
|
func IsTerminal() bool {
|
|
|
|
_, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA)
|
|
|
|
return err == nil
|
|
|
|
}
|