github.com/pubgo/xprocess@v0.1.11/xprocess_isatty/isatty_plan9.go (about) 1 // +build plan9 2 3 package xprocess_isatty 4 5 import ( 6 "syscall" 7 ) 8 9 // IsTerminal returns true if the given file descriptor is a terminal. 10 func IsTerminal(fd uintptr) bool { 11 path, err := syscall.Fd2path(int(fd)) 12 if err != nil { 13 return false 14 } 15 return path == "/dev/cons" || path == "/mnt/term/dev/cons" 16 } 17 18 // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 19 // terminal. This is also always false on this environment. 20 func IsCygwinTerminal(fd uintptr) bool { 21 return false 22 }