Sfoglia il codice sorgente

Add missing function for plan9

Yasuhiro Matsumoto 6 anni fa
parent
commit
88ba11cfdc
3 ha cambiato i file con 12 aggiunte e 1 eliminazioni
  1. 3 1
      go.mod
  2. 2 0
      go.sum
  3. 7 0
      isatty_plan9.go

+ 3 - 1
go.mod

@@ -1,3 +1,5 @@
 module github.com/mattn/go-isatty
 
-require golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a
+require golang.org/x/sys v0.0.0-20191008105621-543471e840be
+
+go 1.14

+ 2 - 0
go.sum

@@ -1,2 +1,4 @@
 golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ=
 golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU=
+golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

+ 7 - 0
isatty_plan9.go

@@ -6,6 +6,7 @@ import (
 	"syscall"
 )
 
+// IsTerminal returns true if the given file descriptor is a terminal.
 func IsTerminal(fd uintptr) bool {
 	path, err := syscall.Fd2path(fd)
 	if err != nil {
@@ -13,3 +14,9 @@ func IsTerminal(fd uintptr) bool {
 	}
 	return path == "/dev/cons" || path == "/mnt/term/dev/cons"
 }
+
+// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
+// terminal. This is also always false on this environment.
+func IsCygwinTerminal(fd uintptr) bool {
+	return false
+}