term

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 10 Imported by: 2

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanUpdateStatus

func CanUpdateStatus(fd uintptr) bool

func SupportsEscapeCodes added in v0.0.6

func SupportsEscapeCodes(fd uintptr) bool

func Truncate

func Truncate(s string, w int) string

Truncate truncates a string to a given width, taking into account ANSI color

Types

type Terminal

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

no implementation for background mode

func NewTerminal

func NewTerminal(w io.Writer, errWriter io.Writer, disableStatus bool) *Terminal

func (*Terminal) Error

func (t *Terminal) Error(line string)

Error writes an error to the terminal.

func (*Terminal) Errorf

func (t *Terminal) Errorf(msg string, args ...interface{})

Errorf uses fmt.Sprintf to write an error line to the terminal.

func (*Terminal) Print

func (t *Terminal) Print(line string)

Print writes a line to the terminal.

func (*Terminal) Printf

func (t *Terminal) Printf(msg string, args ...interface{})

Printf uses fmt.Sprintf to write a line to the terminal.

func (*Terminal) Run

func (t *Terminal) Run(ctx context.Context)

func (*Terminal) SetStatus

func (t *Terminal) SetStatus(lines []string)

SetStatus updates the status lines.

Jump to

Keyboard shortcuts

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