terminal

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 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 terminal decides what the CLI writes to a terminal: whether a stream is a terminal that acts on escape sequences, and whether output to it is colored.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEscapeTerminal

func IsEscapeTerminal(w io.Writer) bool

IsEscapeTerminal reports whether w is a terminal that acts on escape sequences, such as colors and the progress line's clearing: a terminal whose TERM is not dumb, the name of a terminal that acts on none, and whose escape processing is on, which turnOnEscapes turns on where it is off, as on an old Windows console. Output to anything else, or to a console whose processing cannot be turned on, has no escape sequences.

func UseColor

func UseColor(cmd *cobra.Command, w io.Writer) bool

UseColor reports whether the command colors what it writes to w: only when w is a terminal that acts on escape sequences and the user did not turn colors off, with --no-color or with the NO_COLOR environment variable set to a non-empty value (https://no-color.org). Logs, stderr notices and the listen commands' output all follow it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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