minterm

package
v0.0.0-...-f10651d Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: BSD-3-Clause Imports: 6 Imported by: 34

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