Documentation
¶
Overview ¶
Package term styles terminal text using capabilities supplied by logo.Detect. It does not inspect the environment or detect the terminal itself.
Index ¶
- func StripEscapes(text string) string
- func VisibleWidth(text string) int
- type Style
- func (s Style) Accent(text string) string
- func (s Style) Again() string
- func (s Style) Bad(text string) string
- func (s Style) Bold(text string) string
- func (s Style) Check() string
- func (s Style) Dim(text string) string
- func (s Style) OK(text string) string
- func (s Style) Pointer() string
- func (s Style) Question() string
- func (s Style) Rule() string
- func (s Style) Warn(text string) string
- func (s Style) Warning() string
- func (s Style) Width() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StripEscapes ¶
StripEscapes removes terminal escapes, leaving the text as it reads.
func VisibleWidth ¶
VisibleWidth counts runes after removing terminal escapes. This matches rune-based wrapping; it does not measure wide glyphs or combining characters in terminal columns.
Types ¶
type Style ¶
type Style struct {
// contains filtered or unexported fields
}
Style formats text and symbols for a terminal. Its zero value is plain ASCII with a width of 80. Construct a Style with New to use detected capabilities.
func New ¶
New builds a style from capabilities already detected by logo.Detect. As in logo.Render, Color controls escapes; TTY controls the layout width.