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