diff options
author | Thomas Graf <tgraf@suug.ch> | 2014-05-08 15:22:00 +0200 |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2014-05-08 15:22:00 +0200 |
commit | fd461f6568f4deefc870afeeb1860bb3f04cef93 (patch) | |
tree | ac75ba93fd10c79865cf2e9490465c23d68d460c | |
parent | 46ec101b00e1e1a791bb8b587a5c0907c41fd601 (diff) |
curses: only initialize curses module if actually being used
Fixes display problems with plain ascii output
Signed-off-by: Thomas Graf <tgraf@suug.ch>
-rw-r--r-- | src/out_curses.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/out_curses.c b/src/out_curses.c index 5363fb8..fde2ef6 100644 --- a/src/out_curses.c +++ b/src/out_curses.c @@ -1202,6 +1202,13 @@ static int handle_input(int ch) static void curses_pre(void) { + static int init = 0; + + if (!init) { + curses_init(); + init = 1; + } + for (;;) { int ch = getch(); @@ -1267,7 +1274,6 @@ static void curses_parse_opt(const char *type, const char *value) static struct bmon_module curses_ops = { .m_name = "curses", .m_flags = BMON_MODULE_DEFAULT, - .m_init = curses_init, .m_shutdown = curses_shutdown, .m_pre = curses_pre, .m_do = curses_draw, |