terminal

package module
v0.0.0-...-0fc5301 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 6 Imported by: 2

README

terminal

A terminal library for terminal emulator.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	Char      rune
	Width     int
	FG        uint32
	BG        uint32
	Bold      bool
	Underline bool
	Italic    bool
	Blink     bool
}

Cell describes the single character

type Grid

type Grid struct {
	Title         string
	Lines         []*Line
	CursorX       int
	CursorY       int
	CursorVisible bool
	ScrollUp      int
}

Grid for display

type Line

type Line []*Cell

Line includes the glyphs in a line

type LineNoAbs

type LineNoAbs int64

LineNoAbs is the absolute number of line

type Terminal

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

Terminal describes a full featured virtual terminal

func New

func New(rows, cols int) *Terminal

New creates a new terminal

func (*Terminal) GridFromAbsStart

func (t *Terminal) GridFromAbsStart(startLine LineAbsNo, startLineSubNo, displayLines int, flip bool) *Grid

GridFromAbsStart gets the required grid

func (*Terminal) GridFromStart

func (t *Terminal) GridFromStart(startLine, displayLines int, flip bool) *Grid

GridFromStart gets the required grid

func (*Terminal) GridToAbsEnd

func (t *Terminal) GridToAbsEnd(endLine LineAbsNo, endLineSubNo, displayLines int, flip bool) *Grid

GridToAbsEnd gets the required grid

func (*Terminal) GridToEnd

func (t *Terminal) GridToEnd(endLine, displayLines int, flip bool) *Grid

GridToEnd gets the required grid

func (*Terminal) GridVisible

func (t *Terminal) GridVisible(flip bool) *Grid

GridVisible gets the visible grid

func (*Terminal) Resize

func (t *Terminal) Resize(rows, cols int)

Resize the terminal

func (*Terminal) SetHistoryLimit

func (t *Terminal) SetHistoryLimit(size int)

SetHistoryLimit sets the scroll back size

func (*Terminal) SetLogger

func (t *Terminal) SetLogger(log util.Logger)

SetLogger accepts a Logger interface

func (*Terminal) SetMinUpdateInterval

func (t *Terminal) SetMinUpdateInterval(interval time.Duration)

SetMinUpdateInterval sets mininum update interval

func (*Terminal) Start

func (t *Terminal) Start()

Start the terminal loop

func (*Terminal) Stop

func (t *Terminal) Stop()

Stop the terminal

func (*Terminal) WaitUpdate

func (t *Terminal) WaitUpdate()

WaitUpdate waits for the update event

func (*Terminal) Write

func (t *Terminal) Write(p []byte) (n int, err error)

Write implements io.Writer

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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