Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInterrupted = errors.New("interrupted")
ErrInterrupted is returned when user presses Ctrl+C or Ctrl+D.
Functions ¶
func AskConfirm ¶
AskConfirm prompts for a confirmation using huh library. It provides a user-friendly yes/no confirmation dialog.
Note: Output goes to stderr to avoid interfering with stdout piping.
func AskInput ¶
AskInput prompts for a text input with proper CJK/emoji backspace handling.
Note: Output goes to stderr to avoid interfering with stdout piping.
func AskPassword ¶
AskPassword prompts for a password input with asterisk masking. It properly handles UTF-8, CJK characters, emoji, and terminal control sequences. Cross-platform support: Windows, Linux, macOS (via golang.org/x/term).
Note: Output goes to stderr to avoid interfering with stdout piping.
Types ¶
type Pager ¶
type Pager struct {
// contains filtered or unexported fields
}
Pager represents a simple terminal pager built with bubbletea. It implements io.Writer and must be closed to display content.
func NewPager ¶
NewPager creates a new pager with given color mode and alt screen setting. The pager implements io.Writer, content is accumulated via Write calls. Close must be called to display the content in the pager. useAltScreen controls whether to use alternate screen buffer (default true).
func (*Pager) Close ¶
Close finalizes the pager and displays the content. For short content that fits in the terminal, it outputs directly without starting the pager. For longer content, it starts an interactive pager with bubbletea. Close is idempotent - calling it multiple times is safe.