X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Fcurs_lib.c;h=a2b88c811d79fa6fad31a3454e6cdd7b50176e86;hp=2203672748b2f7e90a5b7508744744de6bc71699;hb=3438f31945bb94bc4f4b9603ac47fcde03d5c073;hpb=8b89861e79d1b2e8ddcc54ea4d89957d6d10ebe6 diff --git a/lib-ui/curs_lib.c b/lib-ui/curs_lib.c index 2203672..a2b88c8 100644 --- a/lib-ui/curs_lib.c +++ b/lib-ui/curs_lib.c @@ -26,6 +26,7 @@ #include "mutt.h" #include "pager.h" #include "charset.h" +#include "madtty.h" /* not possible to unget more than one char under some curses libs, and it * is impossible to unget function keys in SLang, so roll our own input @@ -199,6 +200,7 @@ int mutt_yesorno (const char *msg, int def) waddstr (stdscr, (char *) (def == M_YES ? yes : no)); mutt_refresh (); } + CLEARLINE(stdscr, LINES - 1); return (def); } @@ -308,18 +310,18 @@ void mutt_show_error (void) void curses_initialize(void) { + initscr(); + if (start_color() == ERR || !has_colors() || COLORS < 8) + mutt_exit(-1); + madtty_init_colors(); ci_start_color(); - keypad(stdscr, true); - cbreak(); noecho(); - typeahead (-1); /* simulate smooth scrolling */ + raw(); + keypad(stdscr, true); + typeahead(-1); meta(stdscr, true); -} - -void _mutt_perror (const char *s, const char* filename, int line) -{ - char *p = strerror (errno); - mutt_error ("%s: %s (errno = %d) from %s:%i", s, p ? p : _("unknown error"), errno, filename, line); + curs_set(0); + ESCDELAY = 50; } /*