commit | a7c02353c47bc4ec6b30dc9628154ae4fe760c11 | [log] [tgz] |
---|---|---|
author | mattn <mattn.jp@gmail.com> | Tue Oct 17 07:28:21 2023 |
committer | GitHub <noreply@github.com> | Tue Oct 17 07:28:21 2023 |
tree | 2756716ddaf2debb335a38b359075db5b440a333 | |
parent | c067b4f3df49dfc0f376d884e16cfd784ea1874b [diff] | |
parent | 13f35908f730521a4f8b61b19c5e9867a741dbc6 [diff] |
Merge pull request #74 from dkegel-fastly/dkegel-bug73-tinygo Adjust build tags to allow building on tinygo; for #73.
isatty for golang
package main
import (
"fmt"
"github.com/mattn/go-isatty"
"os"
)
func main() {
if isatty.IsTerminal(os.Stdout.Fd()) {
fmt.Println("Is Terminal")
} else if isatty.IsCygwinTerminal(os.Stdout.Fd()) {
fmt.Println("Is Cygwin/MSYS2 Terminal")
} else {
fmt.Println("Is Not Terminal")
}
}
$ go get github.com/mattn/go-isatty
MIT
Yasuhiro Matsumoto (a.k.a mattn)
k-takata: base idea for IsCygwinTerminal