Module terminal

Module terminal 

Source
Expand description

Terminal mode detection for streaming output.

This module provides terminal capability detection to control whether ANSI escape sequences (cursor positioning, colors) should be emitted.

§Terminal Modes

  • Full: Full ANSI support including cursor positioning, colors
  • Basic: Basic TTY with colors but no cursor positioning (e.g., TERM=dumb)
  • None: Non-TTY output (pipes, redirects, CI environments)

§Environment Variables

The detection respects standard environment variables:

  • NO_COLOR=1: Disables all ANSI output
  • TERM=dumb: Enables Basic mode (colors without cursor positioning)
  • CLICOLOR=0: Disables colors on macOS
  • CLICOLOR_FORCE=1: Forces colors even in non-TTY

Enums§

TerminalMode
Terminal capability mode for streaming output.