From a79562b49189a27165ca9ffb38c08aa9e687f97e Mon Sep 17 00:00:00 2001 From: Jaakko Heinonen Date: Wed, 13 Jun 2001 10:15:09 +0000 Subject: [PATCH] Fix launch functions to preserve curses settings --- ChangeLog | 1 + abook.c | 10 ++++++++++ ui.c | 16 ++++++++++++---- ui.h | 1 + 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 42dd5a1..ecc1032 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ - text filter update - query/find code cleanup - fixed snprintf related bugs + - minor bugfixes 0.4.12 - added man page for abookrc (Alan Ford) diff --git a/abook.c b/abook.c index 9c42c08..b79fcae 100644 --- a/abook.c +++ b/abook.c @@ -322,6 +322,11 @@ launch_mutt(int item) #endif system(cmd); free(cmd); + + /* + * we need to make sure that curses settings are correct + */ + ui_init_curses(); } void @@ -343,6 +348,11 @@ launch_wwwbrowser(int item) system(cmd); free(cmd); + + /* + * we need to make sure that curses settings are correct + */ + ui_init_curses(); } void * diff --git a/ui.c b/ui.c index c706963..9a19df7 100644 --- a/ui.c +++ b/ui.c @@ -124,14 +124,22 @@ is_ui_initialized() return ui_initialized; } - -int -init_ui() +void +ui_init_curses() { - initscr(); cbreak(); noecho(); + if(!is_ui_initialized()) + initscr(); + cbreak(); + noecho(); nonl(); intrflush(stdscr, FALSE); keypad(stdscr, TRUE); +} + +int +init_ui() +{ + ui_init_curses(); #ifdef DEBUG fprintf(stderr, "init_abook():\n"); fprintf(stderr, " COLS = %d, LINES = %d\n", COLS, LINES); diff --git a/ui.h b/ui.h index 0444e69..e312abd 100644 --- a/ui.h +++ b/ui.h @@ -9,6 +9,7 @@ enum { }; int is_ui_initialized(); +void ui_init_curses(); int init_ui(); void close_ui(); void headerline(char *str); -- 2.39.2