terminal

package
v0.0.0-...-ad3cfc1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package terminal abstract the terminal by providing two main interfaces: Input Events and a framebuffer output

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fder

type Fder interface {
	Fd() uintptr
}

Fder is the interface that wraps a Fd() filedescriptor. It is require to properly use the terminal

type Terminal

type Terminal struct {
	Input       io.Reader
	Output      io.Writer
	DefaultChar ansi.Char
	// contains filtered or unexported fields
}

Terminal holds the state of the current terminal

func (*Terminal) Close

func (t *Terminal) Close() error

Close resets the terminal to the previous state

func (*Terminal) NextEvent

func (t *Terminal) NextEvent() events.Event

NextEvent return the nextevent in the pipe

func (*Terminal) Open

func (t *Terminal) Open() error

Open opens a terminal. If output

func (*Terminal) Send

func (t *Terminal) Send(cmd string, args ...interface{})

Send send a command to the output

func (*Terminal) Set

func (t *Terminal) Set(row, col int, ch area.Char)

Set changes the character display in the given row/col.

func (*Terminal) Size

func (t *Terminal) Size() (Rows, Cols int)

Size returns the terminal size

func (*Terminal) Sync

func (t *Terminal) Sync()

Sync dump all the changes in the buffer.

func (*Terminal) Write

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

Directories

Path Synopsis
Package ansi converts a given area into a stream of ansi sequences to be dump into a terminal
Package ansi converts a given area into a stream of ansi sequences to be dump into a terminal
Package eachchange will compare two areas
Package eachchange will compare two areas
Package events contains the basic primitives of the input and output events
Package events contains the basic primitives of the input and output events
Package framebuffer stores the current terminal state and return the ansi sequences require to transform the current state to the new one
Package framebuffer stores the current terminal state and return the ansi sequences require to transform the current state to the new one
Package input converts a io.Reader (normally a tty) into a sequence of events.
Package input converts a io.Reader (normally a tty) into a sequence of events.
Package tty implements the os part of the terminal
Package tty implements the os part of the terminal

Jump to

Keyboard shortcuts

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