Skip to content

mattn/go-isatty

Folders and files

NameName
Last commit message
Last commit date
Mar 22, 2023
Aug 14, 2015
Jan 10, 2020
Apr 1, 2014
Mar 21, 2017
Mar 14, 2023
Mar 14, 2023
Jan 10, 2020
May 20, 2023
May 20, 2023
Mar 22, 2023
Jul 22, 2021
Jul 22, 2021
May 20, 2023
Jul 22, 2021
Jul 22, 2021

Repository files navigation

go-isatty

Godoc Reference Codecov Coverage Status Go Report Card

isatty for golang

Usage

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

Installation

$ go get github.com/mattn/go-isatty

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)

Thanks