Documentation
¶
Index ¶
Constants ¶
View Source
const ( Start = "\033[" // Start is the CSI escape code Separator = ";" // Separator allows multiple attributes to be strung together End = "m" // End terminates the CSI sequence and indicates that this is an SGR command )
ECMA-48 strings for constructing CSI SGR directives
Variables ¶
View Source
var ( Reset = Sequence{Pre: "0"} // Reset all Character Attributes to defaults Bold = Sequence{Pre: "1"} // Bold text Dim = Sequence{Pre: "2"} // Dim text, opposite of Bold Underline = Sequence{Pre: "4"} // Underline text Blink = Sequence{Pre: "5"} // Blink text at cursor rate Reverse = Sequence{Pre: "7"} // Reverse FG and BG colors Hidden = Sequence{Pre: "8"} // Hidden suppresses typed characters (e.g. password entry) ResetBold = Sequence{Pre: "22"} // ResetBold turns off Bold/Dim formatting only ResetDim = Sequence{Pre: "22"} // ResetDim turns off Bold/Dim formatting only ResetUnderline = Sequence{Pre: "24"} // ResetUnderline turns off Underline formatting only ResetBlink = Sequence{Pre: "25"} // ResetBlink turns off Blink formatting only ResetReverse = Sequence{Pre: "27"} // ResetReverse turns off Reverse formatting only ResetHidden = Sequence{Pre: "28"} // ResetHidden turns off Hidden formatting only )
CSI Character Attributes (SGR) See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
Functions ¶
This section is empty.
Types ¶
type Sequence ¶
type Sequence struct {
// Pre is added at the start of the formatted string
Pre string
// Post is added at the end of the formatted string
Post string
}
Sequence Represents one or more CSI Character Attributes (SGR)
func Combine ¶
Combine concatenates one or more Sequences together to form a single pre-calculated Sequence
func (Sequence) Func ¶
Func forms a closure around a sequence which allows it to be called as a formatting function
Click to show internal directories.
Click to hide internal directories.