summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/signal.c b/signal.c
index 1f380f2..a95c8fd 100644
--- a/signal.c
+++ b/signal.c
@@ -23,6 +23,32 @@ extern void catcher(int s) {
}
signal(s, catcher);
+#if READLINE
+ if (in_readline) {
+ in_readline = FALSE;
+ switch (s) {
+ default:
+ rl_clean_up_for_exit();
+ rl_deprep_terminal();
+ rl_clear_signals();
+ rl_pending_input = 0;
+ break;
+
+/* These signals are already cleaned up by readline. */
+
+ case SIGINT:
+ case SIGALRM:
+#ifdef SIGTSTP
+ case SIGTSTP:
+ case SIGTTOU:
+ case SIGTTIN:
+#endif
+ break;
+ }
+ }
+#endif /* READLINE */
+
+
#if HAVE_RESTARTABLE_SYSCALLS
interrupt_happened = TRUE;
if (slow)