Fix up ncurses interface so that it handles resizes correctly.
Removed the readline library (still available using if HAVE_READLINE is defined)
since it really doesn't play well with ncurses. The only real feature it added
was command completion, and it didn't really handle it completely correctly anyway.
(If readline printed a completion list, it completely screwed up the screen.)
We now use the wgetch ncurses interface to get input; this allows the PGDN and PGUP
keys to work correctly, and also helped fix up the resizing logic.
diff --git a/ext2ed/init.c b/ext2ed/init.c
index 6ee1d37..de504b4 100644
--- a/ext2ed/init.c
+++ b/ext2ed/init.c
@@ -17,7 +17,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_READLINE
#include <readline.h>
+#endif
#include <signal.h>
#include <unistd.h>
@@ -438,7 +440,9 @@
void init_readline (void)
{
+#ifdef HAVE_READLINE
rl_completion_entry_function=(Function *) complete_command;
+#endif
}
void init_signals (void)
@@ -453,7 +457,11 @@
void signal_SIGWINCH_handler (int sig_num)
{
- redraw_request=1; /* We will handle it in main.c */
+ redraw_request=1; /* We will handle it in main.c */
+
+ /* Reset signal handler */
+ signal (SIGWINCH, signal_SIGWINCH_handler);
+
}
void signal_SIGTERM_handler (int sig_num)