terminal

package
v0.0.0-...-695a870 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Unknown = iota
	CtrlC
	Backspace
	Enter
	Escape
	UpArrow
	DownArrow
	Other
)

Variables

This section is empty.

Functions

func InColors

func InColors(c Color, s string)

func Quit

func Quit(t Term)

func RunTerm

func RunTerm[T any](maps []map[string]T) (map[string]T, error)

Types

type Color

type Color string
const (
	Red    Color = "\033[31m"
	Reset  Color = "\033[0m"
	Green  Color = "\033[32m"
	Blue   Color = "\033[34m"
	Cyan   Color = "\033[36m"
	Yellow Color = "\033[33m"
)

type EscapeCode

type EscapeCode string
const (
	// Escape codes
	Clear       EscapeCode = "\033[H\033[2J\033[H" // Clear screen and reset cursor
	ResetCursor EscapeCode = "\033[0G"             // Move cursor to the beginning of the line
	HideCursor  EscapeCode = "\033[?25l"
	ShowCursor  EscapeCode = "\033[?25h"
)

type Key

type Key int

type Term

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

func NewTerm

func NewTerm() Term

type Terminal

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

func (*Terminal) Clear

func (t *Terminal) Clear()

func (*Terminal) Close

func (t *Terminal) Close()

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
JackTT - Gopher 🇻🇳