tty

status: stablestatusstable
tty version on Hex license: MITlicenseMIT
written in: Gleamwritten inGleam
docs: hexdocsdocshexdocs

TTY and ANSI color-support detection for Gleam on Erlang and JavaScript.

Detect whether stdout or stderr connects to a terminal and determine its ANSI color support. Tty respects NO_COLOR, FORCE_COLOR, and terminal environment variables so CLI output can adapt to interactive terminals, pipes, and CI.

It also detects terminal background hints and returns an unknown result when the environment does not provide enough information. Both Erlang and JavaScript targets are supported.

Available under either the MIT or Apache-2.0 licence. The project uses Trellis for releases.

Powered by

Projects that tty depends on.

  • trellis

    A workspace CLI for multi-package Gleam projects.

Powers

Projects that use tty as a dependency.

  • licence_audit

    Dependency licence auditing, SBOMs, and vulnerability reports for Gleam.

  • spruce

    A terminal-UI kit for styled text, boxes, tables, and Markdown in Gleam.