forked from QuantStack/git2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathansi_code.hpp
More file actions
32 lines (24 loc) · 791 Bytes
/
ansi_code.hpp
File metadata and controls
32 lines (24 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include <string>
/**
* ANSI escape codes.
* Use `termcolor` for colours.
*/
namespace ansi_code
{
// Constants.
const std::string bel = "\a"; // ASCII 7, used for audio/visual feedback.
const std::string cursor_to_top = "\e[H";
const std::string erase_screen = "\e[2J";
const std::string enable_alternative_buffer = "\e[?1049h";
const std::string disable_alternative_buffer = "\e[?1049l";
const std::string hide_cursor = "\e[?25l";
const std::string show_cursor = "\e[?25h";
const std::string bold = "\033[1m";
const std::string reset = "\033[0m";
// Functions.
std::string cursor_to_row(size_t row);
bool is_escape_char(char ch);
bool is_down_arrow(std::string str);
bool is_up_arrow(std::string str);
}