Versions in this module Expand all Collapse all v1 v1.0.0 Jun 20, 2021 Changes in this version + const COLOR_RESET — darwin/amd64, js/wasm, linux/amd64 + const HistoryLimit + const KillRingMax + var ErrInternal = errors.New("liner: internal error") + var ErrInvalidPrompt = errors.New("invalid prompt") + var ErrNotTerminalOutput = errors.New("standard output is not a terminal") + var ErrPromptAborted = errors.New("prompt aborted") + func ColorToString(c Color) string — darwin/amd64, js/wasm, linux/amd64 + func GetOSVer() string — windows/amd64 + func TerminalSupported() bool + type Category int + const CommentType + const IdentType + const KeywordType + const NumberType + const OperatorType + const StringType + type Color uint8 + const COLOR_BLACK + const COLOR_BLUE + const COLOR_CYAN + const COLOR_GREEN + const COLOR_MAGENTA + const COLOR_RED + const COLOR_WHITE + const COLOR_YELLOW + type Completer func(line string) []string + type Highlighter struct + func NewHighlighter() *Highlighter + func (h *Highlighter) Highlight() + func (h *Highlighter) RegisterColors(category map[Category]Color) + func (h *Highlighter) RegisterKeywords(keywords []string) + func (h *Highlighter) RegisterOperators(operators []string) + func (h *Highlighter) Reset(input []rune) + type ModeApplier interface + ApplyMode func() error + func TerminalMode() (ModeApplier, error) + type ShouldRestart func(err error) bool + type State struct + func NewLiner() *State + func (s *State) AppendHistory(item string) + func (s *State) ClearHistory() + func (s *State) Close() error + func (s *State) IsInwinConsole() bool + func (s *State) PasswordPrompt(p string) (string, error) + func (s *State) PasswordPrompt(prompt string) (string, error) + func (s *State) Prompt(p string) (string, error) + func (s *State) Prompt(prompt string) (string, error) + func (s *State) PromptWithSuggestion(prompt string, text string, pos int) (string, error) + func (s *State) ReadHistory(r io.Reader) (num int, err error) + func (s *State) RegisterColors(category map[Category]Color) + func (s *State) RegisterKeywords(keywords []string) + func (s *State) RegisterOperators(operators []string) + func (s *State) SetCompleter(f Completer) + func (s *State) SetCtrlCAborts(aborts bool) + func (s *State) SetMultiLineMode(mlmode bool) + func (s *State) SetShouldRestart(f ShouldRestart) + func (s *State) SetSyntaxHighlight(color bool) + func (s *State) SetTabCompletionStyle(tabStyle TabStyle) + func (s *State) SetWordCompleter(f WordCompleter) + func (s *State) WriteHistory(w io.Writer) (num int, err error) + type TabStyle int + const TabCircular + const TabPrints + type WordCompleter func(line string, pos int) (head string, completions []string, tail string)