tty

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package tty implements the os part of the terminal

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TTY

type TTY struct {
	Fd int
	// contains filtered or unexported fields
}

TTY is a basic structure to control the terminal state

func (*TTY) OnResize

func (t *TTY) OnResize(cbk func(rows, cols int)) error

OnResize listen of the SIGWINCH event (trigger by terminal apps after the terminal changes its sizes). The callback cbk is also called the first time this function is called even if not SIGWINCH is called.

func (*TTY) RawMode

func (t *TTY) RawMode() error

RawMode sets the terminal into RawMode

func (*TTY) Restore

func (t *TTY) Restore() error

Restore returns the tty to the state save with SaveTTYState

func (*TTY) SaveTTYState

func (t *TTY) SaveTTYState() error

SaveTTYState records the current low level terminal state

func (*TTY) TermSize

func (t *TTY) TermSize() (rows, cols int, err error)

TermSize returns the terminal size

Jump to

Keyboard shortcuts

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