package isatty
Import Path
github.com/mattn/go-isatty (on go.dev)
Dependency Relation
imports 2 packages, and imported by 2 packages
Involved Source Files
Package isatty implements interface to isatty
isatty_linux.go
isatty_others.go
Code Examples
{
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")
}
}
Package-Level Functions (total 2, both are exported)
IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
terminal. This is also always false on this environment.
IsTerminal return true if the file descriptor is terminal.
Package-Level Constants (only one, which is unexported)
The pages are generated with Golds v0.3.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |