font color unchanged
xzhangxian1008 opened this issue · comments
Although indicators
does not directly handle the SIGINT signal, you can handle this like so:
static inline void signal_handler(int signal) {
indicators::show_console_cursor(true);
std::cout << termcolor::reset;
exit(signal);
}
int main() {
// Register signal handler
std::signal(SIGTERM, signal_handler);
std::signal(SIGSEGV, signal_handler);
std::signal(SIGINT, signal_handler);
This will call the signal handler when you CTRL+C
and reset the terminal changes made by the library