readline

package
v0.0.0-...-b98e16c Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Null      = 0
	CtrlA     = 1
	CtrlB     = 2
	CtrlC     = 3
	CtrlD     = 4
	CtrlE     = 5
	CtrlF     = 6
	Bell      = 7
	CtrlH     = 8
	Tab       = 9
	CtrlJ     = 10
	Kill      = 11
	CtrlL     = 12
	Enter     = 13
	Next      = 14
	Prev      = 16
	BckSearch = 18
	FwdSearch = 19
	Transpose = 20
	CtrlU     = 21
	CtrlW     = 23
	CtrlY     = 25
	CtrlZ     = 26
	Esc       = 27
	Backspace = 127
)

Variables

View Source
var (
	ErrComplete = errors.New("Complete") // readline complete

	ErrInterrupt = errors.New("Interrupt")
)

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

TODO: placeholder

func NewBuffer

func NewBuffer(prompt, altPrompt string) *Buffer

type Config

type Config struct {
	Prompt      string
	AltPrompt   string
	HistoryFile string
}

type History

type History struct {
	// contains filtered or unexported fields
}

TODO: implement history persistence

func NewHistory

func NewHistory(file string) *History

func (*History) Add

func (h *History) Add(entry []rune)

func (*History) Next

func (h *History) Next() []rune

func (*History) Prev

func (h *History) Prev() []rune

func (*History) Save

func (h *History) Save() error

type Readline

type Readline struct {
	// contains filtered or unexported fields
}

func New

func New(config *Config) (*Readline, error)

func (*Readline) Close

func (rl *Readline) Close() error

func (*Readline) Read

func (rl *Readline) Read() (string, error)

type Terminal

type Terminal struct {
	// contains filtered or unexported fields
}

func NewTerminal

func NewTerminal() (*Terminal, error)

func (*Terminal) Close

func (t *Terminal) Close() error

func (*Terminal) EnterRaw

func (t *Terminal) EnterRaw() error

func (*Terminal) ExitRaw

func (t *Terminal) ExitRaw() error

func (*Terminal) Read

func (t *Terminal) Read() (rune, error)

type Termios

type Termios syscall.Termios

Jump to

Keyboard shortcuts

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