prompt

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromptForInput

func PromptForInput(label string) (string, error)

func PromptForInputWithDefault

func PromptForInputWithDefault(label, defaultValue string) (string, error)

Types

type BellSkipper

type BellSkipper struct{}

bellSkipper implements an io.WriteCloser that skips the terminal bell character (ASCII code 7), and writes the rest to os.Stderr. It is used to replace readline.Stdout, that is the package used by promptui to display the prompts.

This is a workaround for the bell issue documented in https://github.com/manifoldco/promptui/issues/49.

func (*BellSkipper) Close

func (bs *BellSkipper) Close() error

Close implements an io.WriterCloser over os.Stderr.

func (*BellSkipper) Write

func (bs *BellSkipper) Write(b []byte) (int, error)

Write implements an io.WriterCloser over os.Stderr, but it skips the terminal bell character.

Jump to

Keyboard shortcuts

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