term

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnvironmentOverrideColors bool
	DisableColors             bool // no colorful paint? false to disable colorful paint.
	ForceColors               bool // always colorful paint? true to enable colorful paint even if the underlying tty cannot support ANSI escaped sequences.
)

Functions

func GetTtySize

func GetTtySize() (cols, rows int)

GetTtySize returns the window size in columns and rows in the active console window. The return value of this function is in the order of cols, rows.

func IsColored

func IsColored(w io.Writer) bool

IsColored detects a writer if it is a colorful tty device.

A colorful tty device can receive ANSI escaped sequences and draw its.

func IsTty

func IsTty(w io.Writer) bool

IsTty detects a writer if it is abstracting from a tty (console, terminal) device.

func IsTtyEscaped

func IsTtyEscaped(s string) bool

IsTtyEscaped detects a string if it contains ansi color escaped sequences

func ReadPassword

func ReadPassword() (text string, err error)

ReadPassword reads the password from stdin with safe protection

func StripEscapes

func StripEscapes(str string) (strCleaned string)

StripEscapes removes any ansi color escaped sequences from a string

Types

This section is empty.

Directories

Path Synopsis
Package color provides a wrapped standard output device like printf but with colored enhancements.
Package color provides a wrapped standard output device like printf but with colored enhancements.

Jump to

Keyboard shortcuts

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