# go-isatty

> isatty for Go: tell whether output goes to a terminal

Source: https://talira.ai/catalog/go-isatty-gd0w1ny3
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / terminal ui](https://talira.ai/categories/libraries/terminal-ui), [languages / go](https://talira.ai/categories/languages/go)
- Licence: MIT[^1][^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Yasuhiro Matsumoto](https://talira.ai/orgs/yasuhiro-matsumoto.md)

go-isatty is Yasuhiro Matsumoto's small Go package that tells whether a file descriptor is a terminal: `isatty.IsTerminal(os.Stdout.Fd())`, plus `IsCygwinTerminal` for Cygwin and MSYS2 terminals on Windows.

## Links

- GitHub: https://github.com/mattn/go-isatty

## Problems it solves

- check whether stdout is a terminal in Go before printing colours
- detect when my Go CLI's output is piped to a file
- detect a Cygwin or MSYS2 terminal from Go on Windows

## Features

- IsTerminal check for a file descriptor
- IsCygwinTerminal for Cygwin and MSYS2 terminals
- no setup beyond go get

## Trust

Overall: 0.34 out of 1.
Signals: maintenance 0.27, adoption 0.59, momentum 0.26, community 0.60, backing 0.30, extensibility 0.00.

- 925 GitHub stars
- 30 contributors
- accepts sponsorship (Patreon)
- backed by Yasuhiro Matsumoto

Warnings:

- last commit 4 months ago

## Alternatives

- [color (Go)](https://talira.ai/catalog/color-go-y7z3s2fy.md): Coloured terminal output for Go with ANSI escape codes

## Sources

[^1]: https://github.com/mattn/go-isatty/blob/master/LICENSE (checked 29 Nov 2026)
[^2]: https://github.com/mattn/go-isatty/blob/master/README.md (checked 29 Nov 2026)
