1
0
Fork 0

Cut down on repetition with ansi constants
timw4mail/gilo/pipeline/head This commit looks good Details

This commit is contained in:
Timothy Warren 2021-03-30 21:22:28 -04:00
parent 87e742af5c
commit d2a6c480a7
1 changed files with 6 additions and 6 deletions

View File

@ -12,22 +12,22 @@ const EscPrefix = "\x1b["
const (
// Clears the line after the escape sequence
ClearLine = "\x1b[K"
ClearLine = EscPrefix + "K"
// Clears the entire screen
ClearScreen = "\x1b[2J"
ClearScreen = EscPrefix + "2J"
)
// Cursor Codes
const (
HideCursor = "\x1b[?25l"
ShowCursor = "\x1b[?25h"
HideCursor = EscPrefix + "?25l"
ShowCursor = EscPrefix + "?25h"
// Reports cursor location to stdout
LocateCursor = "\x1b[6n"
LocateCursor = EscPrefix + "6n"
// Moves cursor to default position (1,1)
ResetCursor = "\x1b[H"
ResetCursor = EscPrefix + "H"
)
// ----------------------------------------------------------------------------