Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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. }