termx

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package termx probes the terminal/environment context shared by the CLI format axis and the (reserved) style axis: whether an output writer is an interactive terminal, and whether colour is suppressed by the environment. It is a leaf package (zero third-party dependencies) so both the cli frontend and the root dispatcher can use it without an import cycle.

xyz-spec §10.7a pins format and style as two orthogonal axes that share this one TTY probe; termx is that shared seam.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Interactive

func Interactive(w io.Writer) bool

Interactive reports whether w is an interactive terminal (TTY). A nil w falls back to os.Stdout. Only an *os.File that is a character device counts as interactive; buffers, pipes and redirected files are not. Embedding code that cannot stat a real device should treat the result as non-interactive.

func NoColor

func NoColor() bool

NoColor reports whether colour output is suppressed by the environment: the NO_COLOR convention (any non-empty value) or TERM=dumb. This is the style axis' input (xyz-spec §10.7a); it is independent of Interactive — a real terminal with NO_COLOR set is interactive but colourless. Reserved for the colour renderer; exposed now so hosts can query it.

func StdoutInteractive

func StdoutInteractive() bool

StdoutInteractive reports whether the process's os.Stdout is a TTY.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL