MCPcopy Index your code
hub / github.com/mattn/go-isatty

github.com/mattn/go-isatty @v0.0.22

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.22 ↗ · + Follow
19 symbols 32 edges 10 files 14 documented · 74% 1,036 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

  • k-takata: base idea for IsCygwinTerminal

    https://github.com/k-takata/go-iscygpty

Core symbols most depended-on inside this repo

isCygwinPipeName
called by 3
isatty_windows.go
getFileNameByHandle
called by 1
isatty_windows.go
IsTerminal
called by 1
isatty_bsd.go
IsCygwinTerminal
called by 1
isatty_bsd.go
IsTerminal
called by 0
isatty_solaris.go
IsCygwinTerminal
called by 0
isatty_solaris.go
IsTerminal
called by 0
isatty_tcgets.go
IsCygwinTerminal
called by 0
isatty_tcgets.go

Shape

Function 19

Languages

Go100%

Modules by API surface

isatty_windows.go5 symbols
isatty_tcgets.go2 symbols
isatty_solaris.go2 symbols
isatty_plan9.go2 symbols
isatty_others_test.go2 symbols
isatty_others.go2 symbols
isatty_bsd.go2 symbols
isatty_windows_test.go1 symbols
example_test.go1 symbols

For agents

$ claude mcp add go-isatty \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact