Fix issue where last line is not cleared when SIGINT is received

When we close the application using the quit function F10, the last line
is cleared so that on terminals which do not support ALTBUF the last
line is not clobbered. This do not happen when the application exits as
a result of a signal (SIGINT,SIGTERM,SIGQUIT).

Move the logic to clear the last line into the CRT_done function. This
ensures that it will be executed when the CRT_handleSIGTERM is called.
This commit is contained in:
Emmanuel Mathi-Amorim 2021-11-30 22:47:12 -05:00 committed by BenBE
parent 43e9be5a8f
commit ff0ea41c86
2 changed files with 5 additions and 5 deletions

5
CRT.c
View File

@ -961,6 +961,11 @@ IGNORE_WCASTQUAL_END
}
void CRT_done() {
attron(CRT_colors[RESET_COLOR]);
mvhline(LINES - 1, 0, ' ', COLS);
attroff(CRT_colors[RESET_COLOR]);
refresh();
curs_set(1);
endwin();

View File

@ -375,11 +375,6 @@ int CommandLine_run(const char* name, int argc, char** argv) {
ScreenManager_run(scr, NULL, NULL);
attron(CRT_colors[RESET_COLOR]);
mvhline(LINES - 1, 0, ' ', COLS);
attroff(CRT_colors[RESET_COLOR]);
refresh();
Platform_done();
CRT_done();