Veritable Lasagna
An Allocator & Data Structure Library for C.
Loading...
Searching...
No Matches
vl_ansi_term.h
Go to the documentation of this file.
1
14#ifndef VL_ANSI_TERM_H
15#define VL_ANSI_TERM_H
16
17// ANSI escape introducer (Control Sequence Introducer)
18#define VL_ANSI_CSI "\x1b["
19
20// ---- Text attributes ----
21
22#define VL_ANSI_RESET "\x1b[0m"
23#define VL_ANSI_BOLD "\x1b[1m"
24#define VL_ANSI_DIM "\x1b[2m"
25#define VL_ANSI_ITALIC "\x1b[3m"
26#define VL_ANSI_UNDERLINE "\x1b[4m"
27#define VL_ANSI_BLINK "\x1b[5m"
28#define VL_ANSI_REVERSE "\x1b[7m"
29#define VL_ANSI_HIDDEN "\x1b[8m"
30#define VL_ANSI_STRIKETHROUGH "\x1b[9m"
31
32#define VL_ANSI_NO_BOLD_DIM "\x1b[22m"
33#define VL_ANSI_NO_ITALIC "\x1b[23m"
34#define VL_ANSI_NO_UNDERLINE "\x1b[24m"
35#define VL_ANSI_NO_BLINK "\x1b[25m"
36#define VL_ANSI_NO_REVERSE "\x1b[27m"
37#define VL_ANSI_NO_HIDDEN "\x1b[28m"
38#define VL_ANSI_NO_STRIKETHROUGH "\x1b[29m"
39
40// ---- Standard colors (foreground) ----
41
42#define VL_ANSI_FG_BLACK "\x1b[30m"
43#define VL_ANSI_FG_RED "\x1b[31m"
44#define VL_ANSI_FG_GREEN "\x1b[32m"
45#define VL_ANSI_FG_YELLOW "\x1b[33m"
46#define VL_ANSI_FG_BLUE "\x1b[34m"
47#define VL_ANSI_FG_MAGENTA "\x1b[35m"
48#define VL_ANSI_FG_CYAN "\x1b[36m"
49#define VL_ANSI_FG_WHITE "\x1b[37m"
50
51// ---- Standard colors (background) ----
52
53#define VL_ANSI_BG_BLACK "\x1b[40m"
54#define VL_ANSI_BG_RED "\x1b[41m"
55#define VL_ANSI_BG_GREEN "\x1b[42m"
56#define VL_ANSI_BG_YELLOW "\x1b[43m"
57#define VL_ANSI_BG_BLUE "\x1b[44m"
58#define VL_ANSI_BG_MAGENTA "\x1b[45m"
59#define VL_ANSI_BG_CYAN "\x1b[46m"
60#define VL_ANSI_BG_WHITE "\x1b[47m"
61
62// ---- Bright colors (foreground) ----
63
64#define VL_ANSI_FG_BRIGHT_BLACK "\x1b[90m"
65#define VL_ANSI_FG_BRIGHT_RED "\x1b[91m"
66#define VL_ANSI_FG_BRIGHT_GREEN "\x1b[92m"
67#define VL_ANSI_FG_BRIGHT_YELLOW "\x1b[93m"
68#define VL_ANSI_FG_BRIGHT_BLUE "\x1b[94m"
69#define VL_ANSI_FG_BRIGHT_MAGENTA "\x1b[95m"
70#define VL_ANSI_FG_BRIGHT_CYAN "\x1b[96m"
71#define VL_ANSI_FG_BRIGHT_WHITE "\x1b[97m"
72
73// ---- Bright colors (background) ----
74
75#define VL_ANSI_BG_BRIGHT_BLACK "\x1b[100m"
76#define VL_ANSI_BG_BRIGHT_RED "\x1b[101m"
77#define VL_ANSI_BG_BRIGHT_GREEN "\x1b[102m"
78#define VL_ANSI_BG_BRIGHT_YELLOW "\x1b[103m"
79#define VL_ANSI_BG_BRIGHT_BLUE "\x1b[104m"
80#define VL_ANSI_BG_BRIGHT_MAGENTA "\x1b[105m"
81#define VL_ANSI_BG_BRIGHT_CYAN "\x1b[106m"
82#define VL_ANSI_BG_BRIGHT_WHITE "\x1b[107m"
83
84// ---- Default colors ----
85//
86#define VL_ANSI_FG_DEFAULT "\x1b[39m"
87#define VL_ANSI_BG_DEFAULT "\x1b[49m"
88
89// ---- Cursor + screen controls----
90
91#define VL_ANSI_CLEAR_SCREEN "\x1b[2J"
92#define VL_ANSI_CLEAR_SCROLLBACK "\x1b[3J"
93#define VL_ANSI_CLEAR_LINE "\x1b[2K"
94
95#define VL_ANSI_CURSOR_HOME "\x1b[H"
96#define VL_ANSI_CURSOR_SAVE "\x1b[s"
97#define VL_ANSI_CURSOR_RESTORE "\x1b[u"
98#define VL_ANSI_CURSOR_HIDE "\x1b[?25l"
99#define VL_ANSI_CURSOR_SHOW "\x1b[?25h"
100
101#define VL_ANSI_WRAP_ENABLE "\x1b[?7h"
102#define VL_ANSI_WRAP_DISABLE "\x1b[?7l"
103
104#endif // VL_ANSI_TERM_H