minterm

package
v1.0.0-43 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2015 License: BSD-3-Clause, BSD-3-Clause Imports: 7 Imported by: 0

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.

func (*MinTerm) Write

func (m *MinTerm) Write(s string) error

Write writes a string to the terminal.

Jump to

Keyboard shortcuts

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