mirror of
https://github.com/troglobit/finit.git
synced 2026-11-12 16:51:25 +00:00
Reinitialize screen at shutdown and when in debug mode
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
992bab2f8f
commit
f858d94d2a
2 files changed
+11
No files matched your search
@@ -110,6 +110,13 @@ 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);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "finit.h"
|
#include "finit.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
static int up = 0;
|
static int up = 0;
|
||||||
static int debug = 0;
|
static int debug = 0;
|
||||||
@@ -65,6 +66,9 @@ void log_exit(void)
|
|||||||
sched_yield();
|
sched_yield();
|
||||||
fputs("\n", stderr);
|
fputs("\n", stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Reinitialize screen, terminal may have been resized at runtime */
|
||||||
|
screen_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void log_open(void)
|
void log_open(void)
|
||||||
|
|||||||
Reference in new issue
Block a user