You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

isatty_plan9.go 492B

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