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.

func IsTerminal

func IsTerminal(fd uintptr) bool

IsTerminal returns true if the file descriptor is terminal which is always false on js and appengine classic which is a sandboxed PaaS.

Source Files

doc.go isatty_others.go

Version
v0.0.19
Published
Mar 22, 2023
Platform
js/wasm
Last checked
18 hours ago

Tools for package owners.