Help us shape the future of Go! Take the 2026 Go Developer Survey

display

package
v5.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 16 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// ModeAuto detect console capabilities
	ModeAuto = "auto"
	// ModeTTY use terminal capability for advanced rendering
	ModeTTY = "tty"
	// ModePlain dump raw events to output
	ModePlain = "plain"
	// ModeQuiet don't display events
	ModeQuiet = "quiet"
	// ModeJSON outputs a machine-readable JSON stream
	ModeJSON = "json"
)
View Source
const (
	DRYRUN_PREFIX = " DRY-RUN MODE - "
)

Variables

View Source
var (
	DoneColor    colorFunc = aec.BlueF.Apply
	TimerColor   colorFunc = aec.BlueF.Apply
	CountColor   colorFunc = aec.YellowF.Apply
	WarningColor colorFunc = aec.YellowF.With(aec.Bold).Apply
	SuccessColor colorFunc = aec.GreenF.Apply
	ErrorColor   colorFunc = aec.RedF.With(aec.Bold).Apply
	PrefixColor  colorFunc = aec.CyanF.Apply
)
View Source
var Mode = ModeAuto

Mode is the effective progress rendering mode for the current command.

It starts as ModeAuto and is resolved during command setup by selectEventProcessor (cmd/compose), which assigns the mode matching the renderer it returns — so code running after setup never observes ModeAuto. The only other writers are the `--quiet` flags of `run` and `build`, which force ModeQuiet from their PreRun hooks.

Functions

func Full

func Full(out io.Writer, info io.Writer, detached bool, opts ...TermOption) api.EventProcessor

Full creates the terminal EventProcessor, built on a model/layout/screen split:

  • tty_model.go — event reducer, pure data, injected clock
  • tty_layout.go — pure (model, size, now) → lines, every line ≤ width
  • tty_screen.go — diff-based repaint of the block, single Write per frame

The writer itself only coordinates: a mutex guards the model and the screen, and the refresh goroutine is stopped through context cancellation so no lifecycle transition can block (Done after Ctrl-C included).

func JSON

func JSON(out io.Writer) api.EventProcessor

func NoColor

func NoColor()

func Plain

func Plain(out io.Writer) api.EventProcessor

func Quiet

func Quiet() api.EventProcessor

Types

type TermOption added in v5.6.0

type TermOption func(*termWriter)

TermOption customizes the Full EventProcessor.

func WithDryRun added in v5.6.0

func WithDryRun() TermOption

WithDryRun prefixes every row with the dry-run marker.

Jump to

Keyboard shortcuts

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