tui

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package tui implements the interactive terminal UI for browsing and managing sessions.

Index

Constants

View Source
const (
	// MinWidth is the minimal terminal width required by TUI in ultra mode.
	MinWidth = 64
	// MinWidthCompact is the preferred minimal terminal width for compact mode.
	MinWidthCompact = 80
	// MinWidthMedium is the preferred minimal terminal width for medium mode.
	MinWidthMedium = 96
	// MinWidthNormal is the preferred minimal terminal width for normal (non-compact) mode.
	MinWidthNormal = 118
	// MinHeight is the minimal terminal height required by TUI.
	MinHeight = 24
)

Variables

This section is empty.

Functions

func DefaultThemeName

func DefaultThemeName() string

func IsCompactWidth added in v0.3.3

func IsCompactWidth(width int) bool

IsCompactWidth reports whether current terminal width should use compact rendering.

func IsTooSmall added in v0.3.1

func IsTooSmall(width, height int) bool

IsTooSmall reports whether current terminal size is below supported bounds.

func IsUltraWidth added in v0.3.3

func IsUltraWidth(width int) bool

IsUltraWidth reports whether current terminal width should use ultra rendering.

func NewCommand

func NewCommand(deps CommandDeps) *cobra.Command

func NormalizeSize added in v0.3.1

func NormalizeSize(width, height int) (int, int)

NormalizeSize applies fallback values when terminal size is unavailable.

func RenderWidth added in v0.3.1

func RenderWidth(width int) int

RenderWidth returns a width safe for rendering without hitting the terminal's last column.

func ValidateTheme

func ValidateTheme(cfgName string, cfgColors map[string]string, flagName string, flagColors []string) error

Types

type CommandDeps

type CommandDeps struct {
	ResolveSessionsRoot func() (string, error)
	ResolveTrashRoot    func() (string, error)
	ResolveLogFile      func() (string, error)
	TUIConfig           config.TUIConfig
}

type Metrics added in v0.3.1

type Metrics struct {
	TotalW        int
	TotalH        int
	Compact       bool
	Tier          layoutTier
	KeysOuterH    int
	MainAreaH     int
	TreeOuterH    int
	GapW          int
	LeftOuterW    int
	RightOuterW   int
	InfoOuterH    int
	PreviewOuterH int
}

Metrics describes the top-level dimensions used by TUI panels.

func Compute added in v0.3.1

func Compute(width, height int) Metrics

Compute calculates panel dimensions for a normalized terminal size.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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