mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00:00
Follow-up to f858d94, only reinitialize screen when toggling debug mode
The screen_init() call for each print() & C:o caused serious screen
artefacts in debug mode. This patch reworks f858d94 to only re-init
screen when toggling debug.
Also, avoid screen_init() completely if started in debug mode.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
ddf1bce642
commit
3d20237959
3 files changed
+13
-10
No files matched your search
+1
-1
@@ -303,7 +303,7 @@ int main(int argc, char* argv[])
|
|||||||
conf_parse_cmdline();
|
conf_parse_cmdline();
|
||||||
|
|
||||||
/* Set up canvas */
|
/* Set up canvas */
|
||||||
if (!rescue)
|
if (!rescue && !log_is_debug())
|
||||||
screen_init();
|
screen_init();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -110,13 +110,6 @@ void print(int action, const char *fmt, ...)
|
|||||||
if (log_is_silent())
|
if (log_is_silent())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
|
||||||
* In debug mode we must reinitialize often, user may be
|
|
||||||
* resizing their terminal to cope with debug output.
|
|
||||||
*/
|
|
||||||
if (log_is_debug())
|
|
||||||
screen_init();
|
|
||||||
|
|
||||||
if (fmt) {
|
if (fmt) {
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
printv(fmt, ap);
|
printv(fmt, ap);
|
||||||
|
|||||||
@@ -67,8 +67,14 @@ void log_exit(void)
|
|||||||
fputs("\n", stderr);
|
fputs("\n", stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reinitialize screen, terminal may have been resized at runtime */
|
/*
|
||||||
screen_init();
|
* Unless in debug mode at shutdown, Reinitialize screen,
|
||||||
|
* terminal may have been resized at runtime
|
||||||
|
*/
|
||||||
|
if (debug)
|
||||||
|
screen_exit();
|
||||||
|
else
|
||||||
|
screen_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void log_open(void)
|
void log_open(void)
|
||||||
@@ -106,9 +112,13 @@ void log_debug(void)
|
|||||||
if (debug) {
|
if (debug) {
|
||||||
silent = 0;
|
silent = 0;
|
||||||
loglevel = LOG_DEBUG;
|
loglevel = LOG_DEBUG;
|
||||||
|
|
||||||
|
screen_exit();
|
||||||
} else {
|
} else {
|
||||||
silent = SILENT_MODE;
|
silent = SILENT_MODE;
|
||||||
loglevel = LOG_NOTICE;
|
loglevel = LOG_NOTICE;
|
||||||
|
|
||||||
|
screen_init();
|
||||||
}
|
}
|
||||||
log_open();
|
log_open();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user