term

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Terminal

type Terminal struct {
	NoInput bool
}

Terminal offers utilities to interact with the terminal.

func New

func New() *Terminal

func (*Terminal) Confirm

func (t *Terminal) Confirm(msg string, defaultAnswer bool) (confirmed, skipped bool)

Confirm is a shortcut to prompt a yes/no question to the user.

func (*Terminal) IsInteractive

func (t *Terminal) IsInteractive() bool

IsInteractive returns whether the app is attached to an interactive terminal and can prompt the user.

func (*Terminal) IsTTY

func (t *Terminal) IsTTY() bool

IsTTY returns whether the app is attached to an interactive terminal.

func (*Terminal) MustStyle

func (t *Terminal) MustStyle(text string, rules ...core.Style) string

func (*Terminal) Style

func (t *Terminal) Style(text string, rules ...core.Style) (string, error)

Style implements core.Styler using ANSI escape codes to be used with a terminal.

func (*Terminal) SupportsUTF8

func (t *Terminal) SupportsUTF8() bool

SupportsUTF8 returns whether the computer is configured to support UTF-8.

Jump to

Keyboard shortcuts

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