-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.cpp
More file actions
45 lines (38 loc) · 1.16 KB
/
config.cpp
File metadata and controls
45 lines (38 loc) · 1.16 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
#include "config.h"
unordered_map<Config::PROMPT_COLOR, string> Config::PROMPT_COLOR_CODE = {
{DEFAULT, "\033[0m"},
{GREEN, "\033[32m"},
{BLUE, "\033[34m"},
{RED, "\033[31m"},
{YELLOW, "\033[33m"},
{MAGENTA, "\033[35m"},
{CYAN, "\033[36m"},
{WHITE, "\033[37m"},
{GRAY, "\033[90m"},
{LIGHT_RED, "\033[91m"},
{LIGHT_GREEN, "\033[92m"},
{LIGHT_YELLOW, "\033[93m"},
{LIGHT_BLUE, "\033[94m"},
{LIGHT_MAGENTA, "\033[95m"},
{LIGHT_CYAN, "\033[96m"},
{LIGHT_WHITE, "\033[97m"},
{NO_COLOR, ""}
};
Config* Config::instance = nullptr;
Config* Config::get_instance() {
//* since, only one thread (of shell process) will access
//* no need to use locks
if (instance == nullptr) {
instance = new Config();
}
return instance;
}
Config::Config() {
//* default
debug_mode = false;
debug_color_enabled = true;
prompt_color_code = Config::PROMPT_COLOR_CODE[PROMPT_COLOR::LIGHT_CYAN];
prompt_cwd_color_code = Config::PROMPT_COLOR_CODE[PROMPT_COLOR::LIGHT_GREEN];
debug_color = Config::PROMPT_COLOR_CODE[PROMPT_COLOR::YELLOW];
}
Config::~Config() {}