terminal

package
v0.0.0-...-6d4d12d Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package terminal provides an idiomatic Go interface for reading, writing, and restoring terminal capabilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSize

func SetSize(fd uintptr, size image.Point) (err error)

Types

type Terminal

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

Terminal models a virtual terminal's current and former capabilities, so they can be easily altered and restored.

func New

func New(fd uintptr) Terminal

New returns a Terminal for the given file descriptor, capable of restoring that terminal to its current state.

func (Terminal) Bounds

func (t Terminal) Bounds() (image.Rectangle, error)

Bounds returns the terminal dimensions as an "image".Rectangle, suitable for constructing a virtual display.

func (*Terminal) Restore

func (t *Terminal) Restore()

Restore resets the terminal capabilities to their original values, at time of construction.

func (Terminal) SetNoEcho

func (t Terminal) SetNoEcho()

SetNoEcho suppresses input to output echoing, so printable characters typed into the terminal are not implicitly written back out.

func (Terminal) SetRaw

func (t Terminal) SetRaw()

SetRaw makes a terminal suitable for full-screen terminal user interfaces, eliminating keyboard shortcuts for job control, echo, line buffering, and escape key debouncing.

func (Terminal) SetSize

func (t Terminal) SetSize(size image.Point) error

SetSize alters the dimensions of the virtual terminal.

func (Terminal) Size

func (t Terminal) Size() (image.Point, error)

Size returns the width and height of the terminal as an "image".Point.

Jump to

Keyboard shortcuts

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