blob: a3c6f6e7dfdb16bc7da767644e7ba5a00d549a5a [file] [log] [blame]
David K. Bainbridge528b3182017-01-23 08:51:59 -08001// +build solaris,!appengine
2
3package logrus
4
5import (
6 "os"
7
8 "golang.org/x/sys/unix"
9)
10
11// IsTerminal returns true if the given file descriptor is a terminal.
12func IsTerminal() bool {
13 _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA)
14 return err == nil
15}