From b819388acc4faa46e296f4e1f173b2cf2be8799f Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sun, 26 Dec 2021 14:17:19 -0500 Subject: Hide cursor during redraws --- goldfishterm/simple.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'goldfishterm/simple.h') diff --git a/goldfishterm/simple.h b/goldfishterm/simple.h index 3f5cc9f..48a7789 100644 --- a/goldfishterm/simple.h +++ b/goldfishterm/simple.h @@ -26,6 +26,13 @@ namespace goldfishterm { +// The type of cursor in use. +enum class CursorVisibility { + kInvisible, + kNormal, + kVeryVisible, +}; + // Looks up escape sequences for the terminal described in the TERM environment // variable, and allows sending those escape sequences to standard output. // @@ -58,6 +65,9 @@ class SimpleTerminalOutput final { // Moves the cursor down one line. void CursorDown() { Emit(StringCapability::kCursorDown); } + // Sets the cursor visibility. + void SetCursorVisibility(CursorVisibility); + private: void Emit(StringCapability, std::vector = {}); -- cgit v1.2.3