go-isatty – github.com/mattn/go-isatty Index | Examples | Files

package isatty

import "github.com/mattn/go-isatty"

Package isatty implements interface to isatty

Example

Code:

{
	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")
	}
}

Index

Examples

Functions

func IsCygwinTerminal

func IsCygwinTerminal(fd uintptr) bool

IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 terminal. This is also always false on this environment.

Source Files

doc.go isatty_others.go

Version
v0.0.3
Published
Sep 25, 2017
Platform
js/wasm
Last checked
14 hours ago

Tools for package owners.