golazy.dev
–
golazy.dev
/
lazytui
/
encoding
/
ansi
/
codes
Index
|
Files
package codes ¶
import "golazy.dev/lazytui/encoding/ansi/codes"
Constants ¶
const CUU, CUD, CUF, CUB, CNL, CPL, CHA, CUP, ED, EL, SU, SD, HVP, SM, RM, SGRFinal ¶
CSI final bytes for common control sequence functions.
const (
CUU byte = 'A'
CUD byte = 'B'
CUF byte = 'C'
CUB byte = 'D'
CNL byte = 'E'
CPL byte = 'F'
CHA byte = 'G'
CUP byte = 'H'
ED byte = 'J'
EL byte = 'K'
SU byte = 'S'
SD byte = 'T'
HVP byte = 'f'
SM byte = 'h'
RM byte = 'l'
SGRFinal byte = 'm'
)
const MouseX10, MouseNormal, MouseButtonEvent, MouseAnyEvent, MouseSGR ¶
Private mode numbers for common DEC/xterm mouse tracking modes.
const (
MouseX10 = 9
MouseNormal = 1000
MouseButtonEvent = 1002
MouseAnyEvent = 1003
MouseSGR = 1006
)
const OSCSetIconAndTitle, OSCSetIconName, OSCSetWindowTitle, OSCHyperlink ¶
OSC command numbers used by xterm-compatible terminals.
const (
OSCSetIconAndTitle = 0
OSCSetIconName = 1
OSCSetWindowTitle = 2
OSCHyperlink = 8
)
Variables ¶
var Reset, Bold, Faint, Italic, Underline, Blink, Inverse, Conceal, CrossedOut, NormalIntensity, NoItalic, NoUnderline, NoBlink, Positive, Reveal, NotCrossedOut, DefaultFg, DefaultBg, Framed, Encircled, Overline, NoFrameCircle, NoOverline ¶
var (
Reset = SGR{0}
Bold = SGR{1}
Faint = SGR{2}
Italic = SGR{3}
Underline = SGR{4}
Blink = SGR{5}
Inverse = SGR{7}
Conceal = SGR{8}
CrossedOut = SGR{9}
NormalIntensity = SGR{22}
NoItalic = SGR{23}
NoUnderline = SGR{24}
NoBlink = SGR{25}
Positive = SGR{27}
Reveal = SGR{28}
NotCrossedOut = SGR{29}
DefaultFg = SGR{39}
DefaultBg = SGR{49}
Framed = SGR{51}
Encircled = SGR{52}
Overline = SGR{53}
NoFrameCircle = SGR{54}
NoOverline = SGR{55}
)
Types ¶
type Control ¶
Control is a C0/C1-style control byte.
type Control byte
type SGR ¶
SGR is a Select Graphic Rendition parameter sequence.
type SGR []int
func Bg256 ¶
Bg256 selects an indexed background color.
func Bg256(index uint8) SGR
func BgRGB ¶
BgRGB selects a truecolor background color.
func BgRGB(r, g, b uint8) SGR
func Fg256 ¶
Fg256 selects an indexed foreground color.
func Fg256(index uint8) SGR
func FgRGB ¶
FgRGB selects a truecolor foreground color.
func FgRGB(r, g, b uint8) SGR
Package codes defines ANSI, ECMA-48, and common terminal extension codes.
The package intentionally contains constants and small value helpers only. Stateful parsing and rendering belong in golazy.dev/lazytui/encoding/ansi.