From: Jaakko Heinonen Date: Fri, 30 May 2003 16:51:31 +0000 (+0000) Subject: workarounds for readline problems X-Git-Tag: upstream/0.6.1~2^2~253 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=95296728ab468aea3830eb6517751dffb4a0e4b2;p=pkg%2Fabook.git workarounds for readline problems --- diff --git a/abook_rl.c b/abook_rl.c index f6877f1..ff59db4 100644 --- a/abook_rl.c +++ b/abook_rl.c @@ -12,6 +12,9 @@ #include "abook.h" #include "abook_rl.h" +#define KEYPAD_HACK 1 /* enable a keypad hack */ +#define CBREAK_HACK 1 /* enable cbreak hack */ + #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -118,9 +121,19 @@ abook_readline(WINDOW *w, int y, int x, char *s, int limit, bool use_completion) if(s && *s) add_history(s); +#ifdef KEYPAD_HACK + keypad(w, FALSE); +#endif +#ifdef CBREAK_HACK nocbreak(); +#endif ret = readline(NULL); +#ifdef CBREAK_HACK cbreak(); +#endif +#ifdef KEYPAD_HACK + keypad(w, TRUE); +#endif if(rl_cancelled && ret) { free(ret);