Categorygithub.com/petermattis/prompt
modulepackage
0.0.0-20211119134157-8913e5d84e7e
Repository: https://github.com/petermattis/prompt.git
Documentation: pkg.go.dev

# README

Prompt Go Reference

Prompt is a command line prompt editor with history, kill-ring, and tab completion. It was inspired by linenoise and derivatives which eschew usage of terminfo/termcap in favor of treating everything like a VT100 terminal. This is taken a bit further with support for additional input escape sequences that cover ~75% of the terminals in the terminfo database. A minimal set of output escape sequences is used for rendering the prompt.

# Packages

No description provided by the author

# Functions

New creates a new Prompt using the supplied options.
WithCompleter allows configuring a callback that will be invoked when text is entered or deleted in order to determine completions of the word at the current position.
No description provided by the author
WithInput allows configuring the input reader for a Prompt.
WithInputFinished allows configuring a callback that will be invoked when enter is pressed to determine if the input is considered complete or not.
WithOutput allows configuring the output writer for a Prompt.
WithSize allows configuring the initial width and height of a Prompt.
WithTTY allows configuring a prompt with a different TTY than stdin/stdout.

# Structs

Prompt contains the state for reading single or multi-line input from a terminal.

# Interfaces

Option defines the interface for Prompt options.

# Type aliases

CompletionFunc is used to find the completions of the word delineated by [wordStart,wordEnd) within text.