Add SIGINT handler

This SIGINT handler is installed on top of an optional
handler that some curses/ncurses implementations provide.

This ensures the curser is properly reset when hitting Ctrl+C.
This commit is contained in:
Benny Baumann 2021-07-13 20:38:08 +02:00 committed by BenBE
parent 09c7e3e136
commit bf22a8fb13
1 changed files with 1 additions and 0 deletions

1
CRT.c
View File

@ -885,6 +885,7 @@ void CRT_init(const Settings* settings, bool allowUnicode) {
sigaction (SIGSYS, &act, &old_sig_handler[SIGSYS]); sigaction (SIGSYS, &act, &old_sig_handler[SIGSYS]);
sigaction (SIGABRT, &act, &old_sig_handler[SIGABRT]); sigaction (SIGABRT, &act, &old_sig_handler[SIGABRT]);
signal(SIGINT, CRT_handleSIGTERM);
signal(SIGTERM, CRT_handleSIGTERM); signal(SIGTERM, CRT_handleSIGTERM);
signal(SIGQUIT, CRT_handleSIGTERM); signal(SIGQUIT, CRT_handleSIGTERM);