bubbletea

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInterrupted = errors.New("interrupted")
	ErrCanceled    = errors.New("selection canceled")
)

Functions

func ConfirmMenu added in v2.13.0

func ConfirmMenu(title string, defaultYes bool) (bool, error)

ConfirmMenu displays an interactive Yes/No selector. Returns true if "Yes" was selected, false if "No" or canceled.

func GetFormattedInputStdin

func GetFormattedInputStdin() (formattedInput string)

func InitialModel

func InitialModel(preprompt *string, programLoop *bool, lastResponse *string, userInputPtr *string) model

func PromptInput added in v2.13.0

func PromptInput(prompt string, history []string) (string, bool, error)

PromptInput runs a single-line input prompt using Bubble Tea. Returns input string, canceled bool (true if Ctrl+C was pressed), and error.

func RestoreTerminal added in v2.13.0

func RestoreTerminal()

func SelectMenu added in v2.13.0

func SelectMenu(title string, options []string, defaultIndex int) (int, string, error)

SelectMenu runs an interactive selection menu using arrow keys and Enter. Returns the selected index, selected option string, or error if canceled or interrupted.

Types

type InputModel added in v2.13.0

type InputModel struct {
	Value    string
	Canceled bool
	// contains filtered or unexported fields
}

func InitialInputModel added in v2.13.0

func InitialInputModel(prompt string, history []string) InputModel

func (InputModel) Init added in v2.13.0

func (m InputModel) Init() tea.Cmd

func (InputModel) Update added in v2.13.0

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

func (InputModel) View added in v2.13.0

func (m InputModel) View() tea.View

type SelectModel added in v2.13.0

type SelectModel struct {
	Title       string
	Options     []string
	Cursor      int
	Selected    int
	Canceled    bool
	Interrupted bool
}

func (SelectModel) Init added in v2.13.0

func (m SelectModel) Init() tea.Cmd

func (SelectModel) Update added in v2.13.0

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

func (SelectModel) View added in v2.13.0

func (m SelectModel) View() tea.View

Jump to

Keyboard shortcuts

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