tui

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectDarkBackground

func DetectDarkBackground() bool

DetectDarkBackground asks the terminal for its background color. It must run before Bubble Tea takes over the terminal, so Run calls it once and the answer is reused for `:theme system` later.

func Run

func Run(ctx context.Context, opts Options) error

Run starts the terminal UI and blocks until it exits.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is the whole terminal UI.

func (*App) Init

func (a *App) Init() tea.Cmd

Init kicks off the index load and the ticker.

func (*App) Update

func (a *App) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update is the Bubble Tea message loop.

func (*App) View

func (a *App) View() string

type Options

type Options struct {
	Backend  backend.Backend
	Target   backend.Target
	OpenPath string
	Version  string
	// WorkspaceSource controls name resolution throughout the session. The
	// TUI defaults to its own workspaces, even inside the desktop launcher.
	WorkspaceSource string
}

Options configure a terminal session.

type Theme

type Theme struct {
	// ID and Name identify the color scheme: "dark-hard", "Gruvbox · Dark Hard".
	ID, Name string
	Dark     bool
	Mode     string
	// ChromaStyle is the registered chroma style that colors fenced code
	// with this palette, in the editor and in the preview.
	ChromaStyle string

	Accent, AccentSoft, Fg, FgDim, FgMuted, Bg, BgPanel, BgSelected, BgStatus lipgloss.Color
	Red, Green, Yellow, Blue, Purple, Aqua                                    lipgloss.Color

	Base          lipgloss.Style
	Dim           lipgloss.Style
	Muted         lipgloss.Style
	Bold          lipgloss.Style
	Title         lipgloss.Style
	Selected      lipgloss.Style
	SelectedFocus lipgloss.Style
	// CursorRow is the quiet, full-width block under the cursor of a
	// navigation surface; focus is told by the border, not by the row.
	CursorRow    lipgloss.Style
	Status       lipgloss.Style
	StatusMode   lipgloss.Style
	StatusError  lipgloss.Style
	Border       lipgloss.Style
	BorderFocus  lipgloss.Style
	TabActive    lipgloss.Style
	TabInactive  lipgloss.Style
	Heading      lipgloss.Style
	Link         lipgloss.Style
	Tag          lipgloss.Style
	Code         lipgloss.Style
	Quote        lipgloss.Style
	Marker       lipgloss.Style
	Checkbox     lipgloss.Style
	Done         lipgloss.Style
	Cursor       lipgloss.Style
	Visual       lipgloss.Style
	SearchHit    lipgloss.Style
	Overlay      lipgloss.Style
	OverlayTitle lipgloss.Style
	Hint         lipgloss.Style
	Emphasis     lipgloss.Style
	Strong       lipgloss.Style
	Frontmatter  lipgloss.Style
	LineNumber   lipgloss.Style
	Overdue      lipgloss.Style
	KeyHint      lipgloss.Style
	Match        lipgloss.Style
}

Theme is the palette the terminal UI draws with. It is built from one of the desktop app's color schemes (internal/themes), resolved to light or dark from theme_mode, or from the terminal background when the mode is auto.

func NewTheme

func NewTheme(sel themes.Selection, tweaks map[string]string, systemDark bool) (Theme, error)

NewTheme resolves a selection against the detected background and builds the palette, the desktop's Quick tweaks applied. A selection that cannot be honored still yields a usable theme, along with the reason.

Jump to

Keyboard shortcuts

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