13 lines
264 B
Go
13 lines
264 B
Go
//go:build windows
|
|
|
|
package tty
|
|
|
|
import "golang.org/x/sys/windows"
|
|
|
|
// IsTerminal returns true if the file descriptor is a terminal.
|
|
func IsTerminal(fd uintptr) bool {
|
|
var mode uint32
|
|
err := windows.GetConsoleMode(windows.Handle(fd), &mode)
|
|
return err == nil
|
|
}
|