term

package
v1.16.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvNoColor    = "NO_COLOR"
	EnvForceColor = "FORCE_COLOR"
	EnvForceTTY   = "FORCE_TTY"
)

Environment variables to control TUI output behavior.

Precedence (highest first):

  1. NO_COLOR -> disable color + control sequences
  2. FORCE_TTY -> enable color + control sequences
  3. FORCE_COLOR -> enable color, control sequences follow TTY detection

Variables

This section is empty.

Functions

This section is empty.

Types

type ModeProvider

type ModeProvider interface {
	TUIMode() OutputMode
}

ModeProvider allows a writer to declare its effective output mode.

This is useful for writer wrappers that preserve the underlying terminal capability (e.g. progress UI writers).

type OutputMode

type OutputMode struct {
	Color   bool
	Control bool
}

OutputMode controls what kind of output is allowed for a writer.

Color: whether ANSI styling (colors/bold) is allowed. Control: whether ANSI control sequences that rewrite the terminal output (spinners, multi-line live updates) are allowed.

func Resolve

func Resolve(out io.Writer) OutputMode

Resolve resolves the effective output mode for the given writer.

func ResolveFile

func ResolveFile(out *os.File) OutputMode

ResolveFile is like Resolve but specialized for *os.File.

Jump to

Keyboard shortcuts

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