terminal

package
v1.27.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IsTerminalIn  = IsTerminal(os.Stdin)
	IsTerminalOut = IsTerminal(os.Stdout)
)
View Source
var ErrNotAttached = errors.New("stdin and stdout must be attached to the foreground terminal")

Functions

func Attached

func Attached(stdin, stdout *os.File) error

func EnterRaw

func EnterRaw(stdin, stdout *os.File) (func(), error)

func IsTerminal

func IsTerminal(stdin io.Reader) bool

IsTerminal returns whether the passed object is a terminal or not.

func RestoreAll

func RestoreAll()

Types

type Input

type Input interface {
	io.Reader
	Cancel() bool
	Close() error
}

func NewInput

func NewInput(f *os.File) (Input, error)

Jump to

Keyboard shortcuts

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