Versions in this module Expand all Collapse all v0 v0.12.1 Jan 17, 2018 v0.12.0 Oct 7, 2017 Changes in this version + func VisualLength(s string) int — windows/amd64 type KeyEvent + Line *Line + type Line struct + Pos int + Text []rune + func (l *Line) AddKeyToLine(key rune) + func (l *Line) Clear() + func (l *Line) CountToLeftWord() int + func (l *Line) CountToRightWord() int + func (l *Line) DeleteLine() + func (l *Line) DeleteRuneUnderCursor() + func (l *Line) DeleteToBeginningOfLine() + func (l *Line) EraseNPreviousChars(n int) + func (l *Line) MoveEnd() + func (l *Line) MoveHome() + func (l *Line) MoveLeft() + func (l *Line) MoveRight() + func (l *Line) MoveToLeftWord() + func (l *Line) MoveToRightWord() + func (l *Line) Set(t []rune, p int) + func (l *Line) Split() (string, string) + func (l *Line) String() string type Prompt + Scroller *Scroller + type Scroller struct + InputWidth int + LeftOverflow rune + MaxLineLength int + RightOverflow rune + ScrollBy int + ScrollOffset int + func NewScroller() *Scroller + func (s *Scroller) Filter(l *Line) ([]rune, int) + func (s *Scroller) Reset() v0.11.1 Apr 27, 2017 Changes in this version type Prompt + LeftOverflow rune + RightOverflow rune v0.11.0 Apr 25, 2017 Changes in this version + const ScrollBy type Prompt + InputWidth int + ScrollBy int + ScrollOffset int v0.10.1 Apr 14, 2017 v0.10.0 Apr 12, 2017 Changes in this version + func VisualLength(s string) int — darwin/amd64, linux/amd64 + type AbsPrompt struct + Out io.Writer + func NewAbsPrompt(r io.Reader, w io.Writer, p string) *AbsPrompt + func (p *AbsPrompt) NeedWrite() bool + func (p *AbsPrompt) PrintCursorMovement() + func (p *AbsPrompt) PrintLine() + func (p *AbsPrompt) PrintPrompt() + func (p *AbsPrompt) ReadLine() (string, error) + func (p *AbsPrompt) SetLocation(x, y int) + func (p *AbsPrompt) SetPrompt(s string) + func (p *AbsPrompt) WriteAll() + func (p *AbsPrompt) WriteChanges() + func (p *AbsPrompt) WriteChangesNoCursor() type KeyEvent + Input *Input + type Prompt struct + AfterKeypress func(event *KeyEvent) + Out io.Writer + func NewPrompt(r io.Reader, w io.Writer, p string) *Prompt + func (p *Prompt) ReadLine() (string, error) + func (p *Prompt) SetPrompt(s string) type Reader + AfterKeypress func(event *KeyEvent) v0.9.0 Dec 29, 2016 Changes in this version + const DefaultMaxLineLength + const KeyBackspace + const KeyCtrlA + const KeyCtrlB + const KeyCtrlC + const KeyCtrlD + const KeyCtrlE + const KeyCtrlF + const KeyCtrlG + const KeyCtrlH + const KeyCtrlI + const KeyCtrlJ + const KeyCtrlK + const KeyCtrlL + const KeyCtrlM + const KeyCtrlN + const KeyCtrlO + const KeyCtrlP + const KeyCtrlQ + const KeyCtrlR + const KeyCtrlS + const KeyCtrlT + const KeyCtrlU + const KeyCtrlV + const KeyCtrlW + const KeyCtrlX + const KeyCtrlY + const KeyCtrlZ + const KeyDelete + const KeyDown + const KeyEnd + const KeyEnter + const KeyEscape + const KeyF1 + const KeyF10 + const KeyF11 + const KeyF12 + const KeyF2 + const KeyF3 + const KeyF4 + const KeyF5 + const KeyF6 + const KeyF7 + const KeyF8 + const KeyF9 + const KeyHome + const KeyInsert + const KeyLeft + const KeyLeftBracket + const KeyPasteEnd + const KeyPasteStart + const KeyPause + const KeyPgDn + const KeyPgUp + const KeyRight + const KeyRightBracket + const KeyUnknown + const KeyUp + const ModAlt + const ModMeta + const ModNone + var CRLF = []byte("\r\n") + var ErrPasteIndicator = pasteIndicatorError + func GetSize(fd int) (width, height int, err error) — darwin/amd64, linux/amd64, windows/amd64 + func IsTerminal(fd int) bool — darwin/amd64, linux/amd64, windows/amd64 + func ReadPassword(fd int) ([]byte, error) — darwin/amd64, linux/amd64, windows/amd64 + func Restore(fd int, state *State) error — darwin/amd64, linux/amd64, windows/amd64 + type DT struct + Echo bool + func Dumb(r io.Reader, w io.Writer) *DT + func (dt *DT) Line() string + func (dt *DT) ReadLine() (line string, err error) + type Input struct + Line []rune + Pos int + func (i *Input) AddKeyToLine(key rune) + func (i *Input) Clear() + func (i *Input) CountToLeftWord() int + func (i *Input) CountToRightWord() int + func (i *Input) DeleteLine() + func (i *Input) DeleteRuneUnderCursor() + func (i *Input) DeleteToBeginningOfLine() + func (i *Input) EraseNPreviousChars(n int) + func (i *Input) MoveEnd() + func (i *Input) MoveHome() + func (i *Input) MoveLeft() + func (i *Input) MoveRight() + func (i *Input) MoveToLeftWord() + func (i *Input) MoveToRightWord() + func (i *Input) Set(l []rune, p int) + func (i *Input) Split() (string, string) + func (i *Input) String() string + type KeyEvent struct + IgnoreDefaultHandlers bool + type KeyModifier int + func ParseKey(b []byte, force bool) (r rune, rl int, mod KeyModifier) + func (m KeyModifier) String() string + type KeyReader struct + ForceParse bool + func NewKeyReader(i io.Reader) *KeyReader + func (r *KeyReader) ReadKeypress() (Keypress, error) + type Keypress struct + Key rune + Modifier KeyModifier + Raw []byte + Size int + type Prompter struct + Out io.Writer + func NewPrompter(r io.Reader, w io.Writer, p string) *Prompter + func (p *Prompter) NeedWrite() bool + func (p *Prompter) PrintCursorMovement() + func (p *Prompter) PrintLine() + func (p *Prompter) PrintPrompt() + func (p *Prompter) ReadLine() (string, error) + func (p *Prompter) SetLocation(x, y int) + func (p *Prompter) SetPrompt(s string) + func (p *Prompter) WriteAll() + func (p *Prompter) WriteChanges() + func (p *Prompter) WriteChangesNoCursor() + type Reader struct + AutoCompleteCallback func(line string, pos int, key rune) (newLine string, newPos int, ok bool) + MaxLineLength int + NoHistory bool + OnKeypress func(event *KeyEvent) + func NewReader(r io.Reader) *Reader + func (r *Reader) LinePos() (string, int) + func (r *Reader) Pos() int + func (r *Reader) ReadLine() (line string, err error) + func (r *Reader) ReadPassword() (line string, err error) + type State struct — darwin/amd64, linux/amd64, windows/amd64 + func GetState(fd int) (*State, error) + func MakeRaw(fd int) (*State, error)