tui

package
v0.0.0-...-b9c6e6e Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StageConsole    = "Initializing console"
	StageMounting   = "Mounting filesystems"
	StageVConsole   = "Configuring vconsole"
	StageUdev       = "Starting udev"
	StageModules    = "Loading kernel modules"
	StageTPM        = "Loading TPM modules"
	StagePCRLock    = "Setting up pcrlock"
	StageLUKS       = "Unlocking encrypted devices"
	StageLVM        = "Activating LVM volumes"
	StageResume     = "Checking hibernate resume"
	StageRoot       = "Mounting root filesystem"
	StageFsck       = "Checking filesystem"
	StageSwitchroot = "Switching to root"
)

Boot stage names

Variables

View Source
View Source
var Program *tea.Program

Program is the global TUI program instance

View Source
var Title string

Functions

func ForceReset

func ForceReset()

ForceReset sends terminal reset sequences to restore TTY state. Call this after Quit() to ensure clean handover to new init. This handles edge cases where the TUI cleanup didn't fully restore the terminal.

func IsEnabled

func IsEnabled() bool

IsEnabled returns true when TUI is available

func PasswordError

func PasswordError(msg string)

PasswordError shows a password error message

func PasswordErrorWithRetry

func PasswordErrorWithRetry(msg string) (string, error)

PasswordErrorWithRetry shows a password error and waits for retry Returns the next password attempt

func PasswordPromptDone

func PasswordPromptDone()

PasswordPromptDone signals that password entry is complete Call this after successful unlock or when giving up on PIN entry

func PromptPassword

func PromptPassword(device string) (string, error)

PromptPassword prompts for a password via the TUI Returns the entered password or an error

func Quit

func Quit()

Quit stops the TUI and waits for it to fully terminate

func ShowTPMError

func ShowTPMError(message string)

ShowTPMError displays a TPM error that prevents unlock Use for non-retryable errors like PCR mismatch

func ShowTPMLockout

func ShowTPMLockout(message, recoveryHint string)

ShowTPMLockout displays a lockout message without PIN prompt Use when TPM is in DA lockout state before prompting for PIN

func StageDone

func StageDone(stage string)

StageDone marks a stage as completed

func StageError

func StageError(stage string, err error)

StageError marks a stage as failed

func Start

func Start() error

Start initializes and starts the TUI

func UpdateStage

func UpdateStage(stage string)

UpdateStage sends a stage update to the TUI

Types

type Model

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

Model represents the boot TUI state

func New

func New() Model

New creates a new boot TUI model

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model

func (Model) View

func (m Model) View() string

View implements tea.Model

type PasswordErrorMsg

type PasswordErrorMsg string

type PasswordErrorWithRetryMsg

type PasswordErrorWithRetryMsg struct {
	Message string
	Done    chan string
}

type PasswordPromptDoneMsg

type PasswordPromptDoneMsg struct{} // Signals password entry is complete

type PasswordPromptMsg

type PasswordPromptMsg struct {
	Device string
	Done   chan string
}

type PasswordResult

type PasswordResult struct {
	Password string
	Err      error
}

PasswordResult is the result of password input

type QuitMsg

type QuitMsg struct{}

type StageDoneMsg

type StageDoneMsg string

type StageErrorMsg

type StageErrorMsg struct {
	Stage string
	Err   error
}

type StageMsg

type StageMsg string

Messages

type TPMErrorMsg

type TPMErrorMsg struct {
	Message string
}

type TPMLockoutMsg

type TPMLockoutMsg struct {
	Message      string
	RecoveryHint string
}

Jump to

Keyboard shortcuts

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