tui

package
v29.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 7 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

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorTitle     = aec.NewBuilder(aec.DefaultF, aec.Bold).ANSI
	ColorPrimary   = aec.NewBuilder(aec.DefaultF, aec.Bold).ANSI
	ColorSecondary = aec.DefaultF
	ColorTertiary  = aec.NewBuilder(aec.DefaultF, aec.Faint).ANSI
	ColorLink      = aec.NewBuilder(aec.LightCyanF, aec.Underline).ANSI
	ColorWarning   = aec.LightYellowF
	ColorFlag      = aec.NewBuilder(aec.Bold).ANSI
	ColorNone      = aec.ANSI(noColor{})
)
View Source
var InfoHeader = Str{
	Plain: " Info -> ",
	Fancy: aec.Bold.Apply(aec.LightCyanB.Apply(aec.BlackF.Apply("i")) + " " + aec.LightCyanF.Apply("Info → ")),
}

Functions

func Chip

func Chip(fg, bg int, content string) string

func Ellipsis

func Ellipsis(s string, length int) string

Ellipsis truncates a string to a given number of runes with an ellipsis at the end. It tries to persist the ANSI escape sequences.

func Width

func Width(s string) int

Width returns the width of the string, ignoring ANSI escape codes. Not all ANSI escape codes are supported yet.

Types

type Output

type Output struct {
	*streams.Out
	// contains filtered or unexported fields
}

func NewOutput

func NewOutput(out *streams.Out) Output

func (Output) Color

func (o Output) Color(clr aec.ANSI) aec.ANSI

func (Output) Print

func (o Output) Print(p ...any)

func (Output) PrintNote

func (o Output) PrintNote(format string, args ...any)

func (Output) PrintWarning

func (o Output) PrintWarning(format string, args ...any)

func (Output) Println

func (o Output) Println(p ...any)

func (Output) PrintlnWithColor

func (o Output) PrintlnWithColor(clr aec.ANSI, args ...any)

func (Output) Sprint

func (o Output) Sprint(all ...any) string

type Str

type Str struct {
	// Fancy is the fancy string representation of the string.
	Fancy string

	// Plain is the plain string representation of the string.
	Plain string
}

func (Str) String

func (p Str) String(isTerminal bool) string

Jump to

Keyboard shortcuts

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