ui

package
v0.9.11 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorTag   = "\033[38;2;128;128;128m" // Muted gray for tags
	ColorReset = "\033[0m"                // Reset to default

	StyleStrikethrough = "\033[9m"  // Strikethrough text
	StyleReset         = "\033[29m" // Reset strikethrough
)

Color constants

View Source
const (
	DefaultTermWidth = 80
)

Terminal defaults

Variables

This section is empty.

Functions

func FormatItem

func FormatItem(id, title string, tags []string, parts string) string

FormatItem formats item components based on what parts are requested. parts: "i" = id, "t" = title, "#" = tags Modifiers: "-" prefix = strikethrough, "+" prefix = normal (no-op) Examples: "it#" = [id] title #tags, "-it" = strikethrough [id] title, "+it#" = [id] title #tags

func FormatTags

func FormatTags(tags []string) string

FormatTags formats a slice of tags as "#tag1 #tag2 #tag3".

func GetTerminalWidth

func GetTerminalWidth() int

GetTerminalWidth returns the current terminal width, or DefaultTermWidth if unavailable.

func PrintUnpushedWarning

func PrintUnpushedWarning(count int)

PrintUnpushedWarning prints a dim hint reminding the user to push.

func PromptPassword

func PromptPassword() (string, error)

PromptPassword prompts the user for a password with hidden input.

func PromptPasswordCustom

func PromptPasswordCustom(prompt string) (string, error)

PromptPasswordCustom prompts with a custom message for password with hidden input.

func PromptPasswordWithConfirmation

func PromptPasswordWithConfirmation() (string, error)

PromptPasswordWithConfirmation prompts twice for password confirmation.

func PromptPasswordWithConfirmationCustom

func PromptPasswordWithConfirmationCustom(prompt1, prompt2 string) (string, error)

PromptPasswordWithConfirmationCustom prompts twice with custom messages.

func TruncateString

func TruncateString(s string, maxLen int) string

TruncateString truncates a string to maxLen runes (Unicode-safe).

Types

This section is empty.

Jump to

Keyboard shortcuts

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