Documentation
¶
Index ¶
Constants ¶
View Source
const ( EscRune = '\u001b' Esc = string(EscRune) CSI = Esc + "[" // Control Sequence Introducer TopLeft = CSI + "H" LeftMost = CSI + "1G" // stays on current line BottomRight = CSI + "32767;32767H" PosSave = CSI + "s" // saves the current cursor position PosRestore = CSI + "u" // restores cursor position to the last save EraseEOL = CSI + "K" // erase to end of current line EraseSOL = CSI + "1K" // erase to start of current line EraseLine = CSI + "2K" // erase from start to end of current line EraseDown = CSI + "J" // erase to end of current line, then everything down to bottom of screen EraseUp = CSI + "1J" // erase to start of current line, then everything up to top of screen EraseScreen = CSI + "2J" // erases everything to background colour, then moves cursor home ShowCursor = CSI + "?25h" HideCursor = CSI + "?25l" GetCursorPos = CSI + "6n" // responds with `ESC [ <r> ; <c> R`, where <r> is row and <c> is column )
View Source
const ( Reset = "0" Bold = "1" Underline = "4" Reverse = "7" UnderlineOff = "24" ReverseOff = "27" FgBlack = "30" FgDarkRed = "31" FgDarkGreen = "32" FgDarkYellow = "33" FgDarkBlue = "34" FgDarkMagenta = "35" FgDarkCyan = "36" FgLightGray = "37" FgReset = "39" // sets foreground color to default BgBlack = "40" BgDarkRed = "41" BgDarkGreen = "42" BgDarkYellow = "43" BgDarkBlue = "44" BgDarkMagenta = "45" BgDarkCyan = "46" BgLightGray = "47" BgReset = "49" // sets background color to default FgDarkGray = "90" FgRed = "91" FgGreen = "92" FgYellow = "93" FgBlue = "94" FgMagenta = "95" FgCyan = "96" FgWhite = "97" BgDarkGray = "100" BgRed = "101" BgGreen = "102" BgYellow = "103" BgBlue = "104" BgMagenta = "105" BgCyan = "106" BgWhite = "107" )
Variables ¶
This section is empty.
Functions ¶
func CropPreservingANSI ¶ added in v0.9.2
CropPreservingANSI crops the unicode runes down to given length, but preserves all ANSI/VT100 escape sequences.
func NextLine ¶
NextLine moves cursor to start of line n below current (stops at bottom of viewable area, does not cause a scroll)
func PrevLine ¶
PrevLine moves cursor to start of line n above current (stops at top of viewable area)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.