minterm

package
v5.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: BSD-3-Clause, BSD-3-Clause Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package minterm implements minimal terminal functions.

Index

Constants

This section is empty.

Variables

View Source
var ErrPromptInterrupted = errors.New("prompt interrupted")

Functions

This section is empty.

Types

type MinTerm

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

MinTerm is a minimal terminal interface.

func New

func New() (*MinTerm, error)

New creates a new MinTerm and opens the terminal file. Any errors that happen while opening or getting the terminal size are returned.

func (*MinTerm) Prompt

func (m *MinTerm) Prompt(prompt string) (string, error)

Prompt gets a line of input from the terminal. It displays the text in the prompt parameter first.

func (*MinTerm) PromptPassword

func (m *MinTerm) PromptPassword(prompt string) (string, error)

PromptPassword gets a line of input from the terminal, but nothing is echoed to the terminal to hide the text.

func (*MinTerm) Shutdown

func (m *MinTerm) Shutdown() error

Shutdown closes the terminal.

func (*MinTerm) Size

func (m *MinTerm) Size() (int, int)

Size returns the width and height of the terminal.

Jump to

Keyboard shortcuts

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