Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTermNotFound indicates that a suitable terminal entry could // not be found. This can result from either not having TERM set, // or from the TERM failing to support certain minimal functionality, // in particular absolute cursor addressability (the cup capability) // is required. For example, legacy "adm3" lacks this capability, // whereas the slightly newer "adm3a" supports it. This failure // occurs most often with "dumb". ErrTermNotFound = errors.New("terminal entry not found") )
Functions ¶
func AddTerminfo ¶
func AddTerminfo(t *Terminfo)
AddTerminfo can be called to register a new Terminfo entry.
func TerminfoNames ¶ added in v2.10.0
func TerminfoNames() []string
Types ¶
type Terminfo ¶
type Terminfo struct {
Name string
Aliases []string
Columns int // cols
Lines int // lines
Colors int // colors
Clear string // clear
EnterCA string // smcup
ExitCA string // rmcup
ShowCursor string // cnorm
HideCursor string // civis
AttrOff string // sgr0
Underline string // smul
Bold string // bold
Blink string // blink
Reverse string // rev
Dim string // dim
Italic string // sitm
EnterKeypad string // smkx
ExitKeypad string // rmkx
SetFg string // setaf
SetBg string // setab
ResetFgBg string // op
SetCursor string // cup
PadChar string // pad
Mouse string // kmous
AltChars string // acsc
EnterAcs string // smacs
ExitAcs string // rmacs
EnableAcs string // enacs
StrikeThrough string // smxx
SetFgBg string // setfgbg
SetFgBgRGB string // setfgbgrgb
SetFgRGB string // setfrgb
SetBgRGB string // setbrgb
InsertChar string // string to insert a character (ich1)
AutoMargin bool // true if writing to last cell in line advances
TrueColor bool // true if the terminal supports direct color
DisableAutoMargin string // smam
EnableAutoMargin string // rmam
XTermLike bool // (XT) has XTerm extensions
}
Terminfo represents a terminfo entry. Note that we use friendly names in Go, but when we write out JSON, we use the same names as terminfo. The name, aliases and smous, rmous fields do not come from terminfo directly.
func LookupTerminfo ¶
LookupTerminfo attempts to find a definition for the named $TERM.
func (*Terminfo) TColor ¶
TColor returns a string corresponding to the given foreground and background colors. Either fg or bg can be set to -1 to elide.
func (*Terminfo) TGoto ¶
TGoto returns a string suitable for addressing the cursor at the given row and column. The origin 0, 0 is in the upper left corner of the screen.
func (*Terminfo) TParm ¶
TParm takes a terminfo parameterized string, such as setaf or cup, and evaluates the string, and returns the result with the parameter applied.
func (*Terminfo) TPuts ¶
TPuts emits the string to the writer, but expands inline padding indications (of the form $<[delay]> where [delay] is msec) to a suitable time (unless the terminfo string indicates this isn't needed by specifying npc - no padding). All Terminfo based strings should be emitted using this function.
Directories
¶
| Path | Synopsis |
|---|---|
|
a
|
|
|
Package base contains the base terminal descriptions that are likely to be needed by any stock application.
|
Package base contains the base terminal descriptions that are likely to be needed by any stock application. |
|
c
|
|
|
d
|
|
|
e
|
|
|
Package extended contains an extended set of terminal descriptions.
|
Package extended contains an extended set of terminal descriptions. |
|
f
|
|
|
g
|
|
|
k
|
|
|
l
|
|
|
p
|
|
|
r
|
|
|
s
|
|
|
t
|
|
|
v
|
|
|
x
|
|