terminal

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package terminal centralizes interactive terminal detection for CLI output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ControlOutputAllowed

func ControlOutputAllowed() bool

ControlOutputAllowed reports whether the environment allows terminal control output.

func IsInteractive

func IsInteractive(file *os.File) bool

IsInteractive reports whether terminal control output is appropriate.

func IsTerminal

func IsTerminal(file *os.File) bool

IsTerminal reports whether file is an actual terminal.

func TruthyEnv

func TruthyEnv(name string) bool

TruthyEnv reports whether an environment variable is set to a truthy value.

func WithIsTerminalForTest

func WithIsTerminalForTest(fn func(*os.File) bool) func()

WithIsTerminalForTest overrides terminal detection and returns a restore function. It is intended for tests that need deterministic TTY policy.

Types

This section is empty.

Jump to

Keyboard shortcuts

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