Documentation
¶
Index ¶
- Constants
- Variables
- func IsTerminal(fd int) bool
- func UnsetRawMode(fd int, termios *Termios) error
- type Buffer
- func (b *Buffer) Add(r rune)
- func (b *Buffer) ClearScreen()
- func (b *Buffer) Delete()
- func (b *Buffer) DeleteBefore()
- func (b *Buffer) DeleteRemaining()
- func (b *Buffer) DeleteWord()
- func (b *Buffer) IsEmpty() bool
- func (b *Buffer) MoveLeft()
- func (b *Buffer) MoveLeftWord()
- func (b *Buffer) MoveRight()
- func (b *Buffer) MoveRightWord()
- func (b *Buffer) MoveToEnd()
- func (b *Buffer) MoveToStart()
- func (b *Buffer) PromptSize() int
- func (b *Buffer) Remove()
- func (b *Buffer) Replace(r []rune)
- func (b *Buffer) Size() int
- func (b *Buffer) String() string
- func (b *Buffer) StringN(n int) string
- func (b *Buffer) StringNM(n, m int) string
- type History
- type Instance
- type InterruptError
- type PasteMode
- type Prompt
- type Terminal
- type Termios
Constants ¶
View Source
const ( CharNull = 0 CharLineStart = 1 CharBackward = 2 CharInterrupt = 3 CharDelete = 4 CharLineEnd = 5 CharForward = 6 CharBell = 7 CharCtrlH = 8 CharTab = 9 CharCtrlJ = 10 CharKill = 11 CharCtrlL = 12 CharEnter = 13 CharNext = 14 CharPrev = 16 CharBckSearch = 18 CharFwdSearch = 19 CharTranspose = 20 CharCtrlU = 21 CharCtrlW = 23 CharCtrlY = 25 CharCtrlZ = 26 CharEsc = 27 CharSpace = 32 CharEscapeEx = 91 CharBackspace = 127 )
View Source
const ( KeyDel = 51 KeyUp = 65 KeyDown = 66 KeyRight = 67 KeyLeft = 68 MetaEnd = 70 MetaStart = 72 )
View Source
const ( CursorUp = "\033[1A" CursorDown = "\033[1B" CursorRight = "\033[1C" CursorLeft = "\033[1D" CursorSave = "\033[s" CursorRestore = "\033[u" CursorUpN = "\033[%dA" CursorDownN = "\033[%dB" CursorRightN = "\033[%dC" CursorLeftN = "\033[%dD" CursorEOL = "\033[E" CursorBOL = "\033[1G" CursorHide = "\033[?25l" CursorShow = "\033[?25h" ClearToEOL = "\033[K" ClearLine = "\033[2K" ClearScreen = "\033[2J" CursorReset = "\033[0;0f" ColorGrey = "\033[38;5;245m" ColorDefault = "\033[0m" StartBracketedPaste = "\033[?2004h" EndBracketedPaste = "\033[?2004l" )
View Source
const ( CharBracketedPaste = 50 CharBracketedPasteStart = "00~" CharBracketedPasteEnd = "01~" )
View Source
const ( PastModeOff = iota PasteModeStart PasteModeEnd )
Variables ¶
View Source
var (
ErrInterrupt = errors.New("Interrupt")
)
Functions ¶
func IsTerminal ¶
IsTerminal returns true if the given file descriptor is a terminal.
func UnsetRawMode ¶
Types ¶
type Buffer ¶
type Buffer struct { Pos int Buf *arraylist.List Prompt *Prompt LineWidth int Width int Height int }
func (*Buffer) ClearScreen ¶
func (b *Buffer) ClearScreen()
func (*Buffer) DeleteBefore ¶
func (b *Buffer) DeleteBefore()
func (*Buffer) DeleteRemaining ¶
func (b *Buffer) DeleteRemaining()
func (*Buffer) DeleteWord ¶
func (b *Buffer) DeleteWord()
func (*Buffer) MoveLeftWord ¶
func (b *Buffer) MoveLeftWord()
func (*Buffer) MoveRightWord ¶
func (b *Buffer) MoveRightWord()
func (*Buffer) MoveToStart ¶
func (b *Buffer) MoveToStart()
func (*Buffer) PromptSize ¶
type History ¶
type History struct { Buf *arraylist.List Autosave bool Pos int Limit int Filename string Enabled bool }
func NewHistory ¶
type Instance ¶
func (*Instance) HistoryDisable ¶
func (i *Instance) HistoryDisable()
func (*Instance) HistoryEnable ¶
func (i *Instance) HistoryEnable()
type InterruptError ¶
type InterruptError struct {
Line []rune
}
func (*InterruptError) Error ¶
func (*InterruptError) Error() string
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
func NewTerminal ¶
Click to show internal directories.
Click to hide internal directories.