blob: a3c6f6e7dfdb16bc7da767644e7ba5a00d549a5a [file] [log] [blame]
Jonathan Hartf86817b2018-08-17 10:35:54 -07001// +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}