gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

isatty_tcgets.go (507B)


      1 //go:build (linux || aix || zos) && !appengine
      2 // +build linux aix zos
      3 // +build !appengine
      4 
      5 package isatty
      6 
      7 import "golang.org/x/sys/unix"
      8 
      9 // IsTerminal return true if the file descriptor is terminal.
     10 func IsTerminal(fd uintptr) bool {
     11 	_, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
     12 	return err == nil
     13 }
     14 
     15 // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
     16 // terminal. This is also always false on this environment.
     17 func IsCygwinTerminal(fd uintptr) bool {
     18 	return false
     19 }