busybox

package
v0.0.0-...-f74eb5f Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResetCursor EscapeCode = "\033[0G"   // Move cursor to the beginning of the line
	HideCursor  EscapeCode = "\033[?25l" // Hide cursor
	Red         Color      = "\033[31m"
	Reset       Color      = "\033[0m"
	Green       Color      = "\033[32m"
	Blue        Color      = "\033[34m"
	Cyan        Color      = "\033[36m"
	Yellow      Color      = "\033[33m"
)

Variables

This section is empty.

Functions

func InColors

func InColors(c Color, s string)

func PrintColored

func PrintColored(color string, text string)

PrintColored prints text in the specified color

func ProcessLine

func ProcessLine(bracket, line string)

func Quit

func Quit(t Term)

func RunTerm

func RunTerm[T Stringer](items []T) (T, error)

Types

type Color

type Color string

type EscapeCode

type EscapeCode string

type HighlightedPager

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

func NewHighlightedPager

func NewHighlightedPager(filename string, content io.Reader) *HighlightedPager

func (*HighlightedPager) Run

func (hp *HighlightedPager) Run() error

type Key

type Key int
const (
	Unknown Key = iota
	CtrlC
	Backspace
	Enter
	Escape
	UpArrow
	DownArrow
	Other
)

type Stringer

type Stringer interface {
	String() string
}

type Term

type Term interface {
	Start()
	Close()
	Clear()
}

func NewTerm

func NewTerm() Term

type Terminal

type Terminal struct {
	Width  int
	Height int
	// contains filtered or unexported fields
}

Terminal implements the Term interface

func (*Terminal) Clear

func (t *Terminal) Clear()

Clear clears the terminal screen

func (*Terminal) Close

func (t *Terminal) Close()

func (*Terminal) GetSize

func (t *Terminal) GetSize() error

func (*Terminal) Start

func (t *Terminal) Start()

Jump to

Keyboard shortcuts

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