+# ifdef __GNUC__
+# warning "You seem to have rather old readline version or \
+non-GNU version of it. If you have problems please use \
+GNU readline 4.3 or newer. \
+GNU readline versions 4.0, 4.1 and 4.2 should be OK despite \
+of this warning."
+# endif
+ /*
+ * this kludge avoids older readline libraries to print a newline
+ */
+ extern int readline_echoing_p;
+ readline_echoing_p = 0;
+#endif
+ raw();
+ keypad(rl_win, FALSE);
+}
+
+static void
+rline_deprep_terminal(void)
+{
+ cbreak();
+ keypad(rl_win, TRUE);
+}
+
+static int
+rl_cancel(int dummy1, int dummy2)
+{
+ rl_cancelled = TRUE;
+
+ rl_done = 1;
+
+ return 0;