87 lines
1.7 KiB
Go
87 lines
1.7 KiB
Go
package aes
|
|
|
|
const (
|
|
KeyESC = '\x1B'
|
|
)
|
|
|
|
const (
|
|
// Start.
|
|
ESC = "\x1B"
|
|
|
|
// Control sequence introducer.
|
|
CSI = ESC+"["
|
|
|
|
// Device control string.
|
|
DCS = ESC+"P"
|
|
|
|
// Operating system command.
|
|
OSC = ESC+"]"
|
|
)
|
|
|
|
// Special control sequences.
|
|
const (
|
|
BEL = "\a"
|
|
BS = "\b"
|
|
HT = "\t"
|
|
LF = "\n"
|
|
VT = "\v"
|
|
FF = "\f"
|
|
CR = "\r"
|
|
DEL = "\x7F"
|
|
)
|
|
|
|
// Erasing control sequences.
|
|
// Names are self describing.
|
|
const (
|
|
EraseInDisplay = CSI+"J"
|
|
EraseFromCursorToEndOfScreen = CSI+"0J"
|
|
EraseFromCursorToBeginOfScreen = CSI+"1J"
|
|
EraseEntireScreen = CSI+"2J"
|
|
EraseSavedLines = CSI+"3J"
|
|
EraseInLine = CSI+"K"
|
|
EraseFromCursorToEndOfLine = CSI+"0K"
|
|
EraseFromStartOfLineToCursor = CSI+"1K"
|
|
EraseEntireLine = CSI+"2K"
|
|
)
|
|
|
|
// Cursor control sequences.
|
|
// Any that ends with the "Format" means that
|
|
// the format is meant to be used via fmt.Sprintf
|
|
// or any fitting function to provide arguments
|
|
// into the escape code.
|
|
const (
|
|
MoveCursorHome = CSI+"H"
|
|
|
|
// Line, column (both int).
|
|
MoveCursorToFormat = CSI+"%d;%dH"
|
|
SecondaryMoveCursorToFormat = CSI+"%d;%df"
|
|
MoveCursorUpFormat = CSI+"%dA"
|
|
MoveCursorDownFormat = CSI+"%dB"
|
|
MoveCursorRightFormat = CSI+"%dC"
|
|
MoveCursorLeftFormat = CSI+"%dD"
|
|
MoveCursorToBeginOfNextLineDownFormat = CSI+"%dE"
|
|
MoveCursorToBeginOfPrevLineUpFormat = CSI+"%dF"
|
|
MoveCursorToColumnFormat = CSI+"%dG"
|
|
|
|
RequestCursorPositionReportFormat =CSI+"%d;%dR"
|
|
RequestCursorPosition = CSI+"6n"
|
|
|
|
SaveCursorPositionDEC = ESC+" 7"
|
|
UnodCursorPositionDEC = ESC+" 8"
|
|
|
|
SaveCursorPositionSCO = CSI+"s"
|
|
UndoCursorPositionSCO = CSI+"u"
|
|
)
|
|
|
|
// Common private modes.
|
|
const (
|
|
MakeCursorInvisible = CSI+"?25l"
|
|
MakeCursorVisible = CSI+"?25h"
|
|
|
|
UndoScreen = CSI+"?47l"
|
|
SaveScreen = CSI+"?47h"
|
|
|
|
EnableAltBuffer = CSI+"?1049h"
|
|
DisableAltBuffer = CSI+"?1049l"
|
|
)
|
|
|