| commit | 13f35908f730521a4f8b61b19c5e9867a741dbc6 | [log] [tgz] |
|---|---|---|
| author | Dan Kegel <[email protected]> | Sun Jun 19 18:05:30 2022 |
| committer | Dan Kegel <[email protected]> | Sat May 20 14:04:22 2023 |
| tree | 2756716ddaf2debb335a38b359075db5b440a333 | |
| parent | c067b4f3df49dfc0f376d884e16cfd784ea1874b [diff] |
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