Documentation
¶
Overview ¶
Package ui provides shared terminal rendering utilities for the CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearScreen ¶
ClearScreen clears the terminal and positions the cursor at the top-left corner.
func Dimensions ¶
Dimensions attempts to determine the terminal size for the provided writer. If the writer is not backed by an *os.File or the lookup fails, it returns a safe default.
func Ellipsis ¶
Ellipsis truncates the provided string to maxLen characters, appending an ellipsis when truncation occurs. For zero or negative lengths it returns an empty string. The function is intentionally ASCII-focused to match existing interactive behavior.
func HideCursor ¶
HideCursor hides the terminal cursor until ShowCursor is called.
Types ¶
type ANSIColors ¶
type ANSIColors struct {
Black string
Red string
Green string
Yellow string
Blue string
Magenta string
Cyan string
White string
BrightBlack string
BrightRed string
BrightGreen string
BrightYellow string
BrightBlue string
BrightMagenta string
BrightCyan string
BrightWhite string
Bold string
Underline string
Reverse string
Reset string
}
ANSIColors defines terminal color escape sequences for both base and bright palettes, plus common text attributes. All fields contain raw ANSI escape codes suitable for writing directly to an io.Writer.
func NewANSIColors ¶
func NewANSIColors() *ANSIColors
NewANSIColors returns a palette initialized with the standard ANSI escape codes.