term

package
v0.0.0-...-b55b034 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttrReset     = "\x1b[0m"
	AttrBold      = "\x1b[1m"
	AttrItalics   = "\x1b[3m"
	AttrUnderline = "\x1b[4m"
	AttrBlink     = "\x1b[5m"

	AttrBlack   = "\x1b[30m"
	AttrRed     = "\x1b[31m"
	AttrGreen   = "\x1b[32m"
	AttrYellow  = "\x1b[33m"
	AttrBlue    = "\x1b[34m"
	AttrMagenta = "\x1b[35m"
	AttrCyan    = "\x1b[36m"
	AttrWhite   = "\x1b[37m"

	AttrGrey          = "\x1b[90m"
	AttrBrightRed     = "\x1b[91m"
	AttrBrightGreen   = "\x1b[92m"
	AttrBrightYellow  = "\x1b[93m"
	AttrBrightBlue    = "\x1b[94m"
	AttrBrightMagenta = "\x1b[95m"
	AttrBrightCyan    = "\x1b[96m"
	AttrBrightWhite   = "\x1b[97m"
)
View Source
const (
	// Additional keys
	KeyArrowUp = Key(iota + 256)
	KeyArrowDown
	KeyArrowLeft
	KeyArrowRight

	KeyCtrlArrowUp
	KeyCtrlArrowDown
	KeyCtrlArrowLeft
	KeyCtrlArrowRight

	KeyResize // Window resize event

	// ASCII keys
	KeyEnter     = Key('\n')
	KeyBackspace = Key(127)
	KeyEscape    = Key(27)
	KeyTab       = Key('\t')

	KeyNone = 0
)
View Source
const (
	CBreak = 1 << iota
	NoEcho
	Echo
	NoIxon
	Ixon
)

Variables

View Source
var (
	Width  = 0
	Height = 0
)

Functions

func ClearCursorLine

func ClearCursorLine()

func ClearLines

func ClearLines(count int)

func HideCursor

func HideCursor()

func InitGetKey

func InitGetKey()

func MoveCursorDown

func MoveCursorDown(by int)

func MoveCursorLeft

func MoveCursorLeft(by int)

func MoveCursorRight

func MoveCursorRight(by int)

func MoveCursorToLineStart

func MoveCursorToLineStart()

func MoveCursorUp

func MoveCursorUp(by int)

func NewLine

func NewLine()

func NewLines

func NewLines(count int)

func OnCtrlC

func OnCtrlC(callback func())

func RestoreMode

func RestoreMode(mode string)

func SaveMode

func SaveMode() string

func SendResizeEvents

func SendResizeEvents()

func SetMode

func SetMode(flags Flag)

func ShowCursor

func ShowCursor()

func Update

func Update()

Types

type Flag

type Flag int

type Key

type Key int

func Ctrl

func Ctrl(key Key) Key

func GetKey

func GetKey(blocking bool) (key Key)

Jump to

Keyboard shortcuts

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