소스 검색

isatty_plan9.go: initial commit (#42)

Based on the best-guess behavior of ape's isatty for Plan 9.
Drew DeVault 6 년 전
부모
커밋
62f712808a
1개의 변경된 파일15개의 추가작업 그리고 0개의 파일을 삭제
  1. 15 0
      isatty_plan9.go

+ 15 - 0
isatty_plan9.go

@@ -0,0 +1,15 @@
+// +build plan9
+
+package isatty
+
+import (
+	"syscall"
+)
+
+func IsTerminal(fd uintptr) bool {
+	path, err := syscall.Fd2path(fd)
+	if err != nil {
+		return false
+	}
+	return path == "/dev/cons" || path == "/mnt/term/dev/cons"
+}