curses: only initialize curses module if actually being used
Fixes display problems with plain ascii output Signed-off-by: Thomas Graf <tgraf@suug.ch>
This commit is contained in:
parent
46ec101b00
commit
fd461f6568
@ -1202,6 +1202,13 @@ static int handle_input(int ch)
|
|||||||
|
|
||||||
static void curses_pre(void)
|
static void curses_pre(void)
|
||||||
{
|
{
|
||||||
|
static int init = 0;
|
||||||
|
|
||||||
|
if (!init) {
|
||||||
|
curses_init();
|
||||||
|
init = 1;
|
||||||
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int ch = getch();
|
int ch = getch();
|
||||||
|
|
||||||
@ -1267,7 +1274,6 @@ static void curses_parse_opt(const char *type, const char *value)
|
|||||||
static struct bmon_module curses_ops = {
|
static struct bmon_module curses_ops = {
|
||||||
.m_name = "curses",
|
.m_name = "curses",
|
||||||
.m_flags = BMON_MODULE_DEFAULT,
|
.m_flags = BMON_MODULE_DEFAULT,
|
||||||
.m_init = curses_init,
|
|
||||||
.m_shutdown = curses_shutdown,
|
.m_shutdown = curses_shutdown,
|
||||||
.m_pre = curses_pre,
|
.m_pre = curses_pre,
|
||||||
.m_do = curses_draw,
|
.m_do = curses_draw,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user