1// +build plan9 2 3package isatty 4 5import ( 6 "syscall" 7) 8 9// IsTerminal returns true if the given file descriptor is a terminal. 10func 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. 20func IsCygwinTerminal(fd uintptr) bool { 21 return false 22} 23