Documentation
¶
Overview ¶
Package prompt provides reusable terminal UI widgets built on charm.land/bubbletea/v2 and charm.land/bubbles/v2.
Every public constructor checks whether stdin is an interactive terminal before starting a bubbletea program. If stdin is not a terminal the constructor returns (zero, ErrNotInteractive) immediately so callers in CI / pipe mode can detect the condition and fall back to non-interactive paths without any risk of hanging.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotInteractive = errors.New("prompt: stdin is not a terminal")
ErrNotInteractive is returned by all constructors when stdin is not a terminal.
Functions ¶
func Confirm ¶
Confirm asks a yes/no question. def is the default answer shown in the prompt (used when the user presses Enter without typing y/n).
Returns (false, ErrNotInteractive) when stdin is not a terminal.
func Input ¶
Input prompts the user for a single-line text value. When masked is true the input is displayed as asterisks (suitable for passwords/tokens).
Returns ("", ErrNotInteractive) when stdin is not a terminal.
func MultiSelect ¶
MultiSelect presents an interactive multi-choice list. Returns the indices of all selected items. Items can be pre-selected via Item.Preselected.
Returns (nil, ErrNotInteractive) when stdin is not a terminal.