2024-06-05 14:18:54 +03:00
|
|
|
package aes
|
|
|
|
|
2024-07-26 21:13:04 +03:00
|
|
|
const (
|
|
|
|
KeyESC = '\x1B'
|
|
|
|
)
|
|
|
|
|
2024-06-05 14:18:54 +03:00
|
|
|
const (
|
|
|
|
// Start.
|
|
|
|
ESC = "\x1B"
|
|
|
|
|
|
|
|
// Control sequence introducer.
|
|
|
|
CSI = ESC+"["
|
|
|
|
|
|
|
|
// Device control string.
|
|
|
|
DCS = ESC+"P"
|
|
|
|
|
|
|
|
// Operating system command.
|
|
|
|
OSC = ESC+"]"
|
|
|
|
)
|
|
|
|
|
2024-07-26 21:13:04 +03:00
|
|
|
// Special control sequences.
|
2024-06-05 14:18:54 +03:00
|
|
|
const (
|
|
|
|
BEL = "\a"
|
|
|
|
BS = "\b"
|
|
|
|
HT = "\t"
|
|
|
|
LF = "\n"
|
|
|
|
VT = "\v"
|
|
|
|
FF = "\f"
|
|
|
|
CR = "\r"
|
|
|
|
DEL = "\x7F"
|
|
|
|
)
|
|
|
|
|
2024-07-26 21:13:04 +03:00
|
|
|
// 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"
|
2024-07-26 22:27:34 +03:00
|
|
|
UndoCursorPositionDEC = ESC+" 8"
|
2024-07-26 21:13:04 +03:00
|
|
|
|
|
|
|
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"
|
|
|
|
)
|
|
|
|
|