isatty_solaris.go 582 B

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