module CriterionPlus.CSI where
import CriterionPlus.Prelude.Basic
import CriterionPlus.Prelude.Data
esc = "\ESC["
csi = "\o033["
cursorUp n = csi <> (cs $ show n) <> "A"
cursorDown n = csi <> (cs $ show n) <> "B"
cursorNextLine n = csi <> (cs $ show n) <> "E"
cursorPreviousLine n = csi <> (cs $ show n) <> "F"
cursorHorizontalAbsolute n = csi <> (cs $ show n) <> "G"
eraseData n = csi <> (cs $ show n) <> "J"
eraseInLine n = csi <> (cs $ show n) <> "K"
eraseLineToEnd = eraseInLine 0
eraseLineToBeginning = eraseInLine 1
eraseLine = eraseInLine 2
saveCursorPosition = csi <> "s"
restoreCursorPosition = csi <> "u"
hideCursor = csi <> "?25l"
showCursor = csi <> "?25h"