blob: 0c3acf2dc288ab543e374e72a402003c027ce98f [file] [log] [blame]
Abhay Kumara61c5222025-11-10 07:32:50 +00001//go:build solaris && !appengine
2// +build solaris,!appengine
3
4package isatty
5
6import (
7 "golang.org/x/sys/unix"
8)
9
10// IsTerminal returns true if the given file descriptor is a terminal.
11// see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c
12func IsTerminal(fd uintptr) bool {
13 _, err := unix.IoctlGetTermio(int(fd), unix.TCGETA)
14 return err == nil
15}
16
17// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
18// terminal. This is also always false on this environment.
19func IsCygwinTerminal(fd uintptr) bool {
20 return false
21}