Versions in this module Expand all Collapse all v0 v0.1.1 Nov 9, 2026 v0.1.0 Nov 9, 2026 Changes in this version + const MaxLine + var ErrInterrupt = errors.New("interrupt") + var ErrUnterminated = errors.New("unterminated quote or escape") + func Format(cs []Candidate, cols int) []string + func Quote(w string, quote byte, closed bool) string + func RuneWidth(r rune) int + func Split(line string) ([]string, error) + func Width(s string) int + type Candidate struct + Description string + Value string + type Completer func(ctx context.Context, words []string, current string) (cands []Candidate, noSpace bool) + type Editor struct + func New(o Options) *Editor + func (e *Editor) History() []string + func (e *Editor) Key(ctx context.Context, k Key) Event + func (e *Editor) Reset() + func (e *Editor) SetCols(n int) + func (e *Editor) SetHistory(h []string) + func (e *Editor) SetPrompt(p string) + func (e *Editor) State() State + type Event struct + Bell bool + Clear bool + EOF bool + Interrupt bool + Line string + Print []string + Submit bool + type Key struct + Code KeyCode + Rune rune + func ParseKeys(data string) []Key + func R(r rune) Key + type KeyCode int + const KeyBackspace + const KeyCtrlA + const KeyCtrlB + const KeyCtrlC + const KeyCtrlD + const KeyCtrlE + const KeyCtrlF + const KeyCtrlG + const KeyCtrlK + const KeyCtrlL + const KeyCtrlN + const KeyCtrlP + const KeyCtrlR + const KeyCtrlU + const KeyCtrlW + const KeyDelete + const KeyDown + const KeyEnd + const KeyEnter + const KeyEscape + const KeyHome + const KeyLeft + const KeyRight + const KeyRune + const KeyTab + const KeyUnknown + const KeyUp + type Options struct + Cols int + Complete Completer + HistorySize int + Prompt string + type Partial struct + Current string + Quote byte + Start int + Words []string + func SplitPartial(prefix string) Partial + type Reader struct + Cols func() int + Complete Completer + HistorySize int + In io.Reader + Out io.Writer + PromptStyle string + func (r *Reader) Editor() *Editor + func (r *Reader) ReadLine(ctx context.Context, prompt string) (string, error) + type Renderer struct + Cols int + PromptStyle string + func (r *Renderer) Forget() + func (r *Renderer) Leave(s State) string + func (r *Renderer) Print(lines []string, s State) string + func (r *Renderer) Render(s State) string + type State struct + Cursor int + Line string + Prompt string