summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authortgoodwin <tgoodwin>1998-02-23 15:45:05 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:05 +0100
commitac8a8fcf0dad4e73b16a584d4ba3c02b89c1b86e (patch)
tree56bf5bd2a1a0f52a66a588b33f0127e1fce0b646 /signal.c
parented765fba692da152247018becb1f407a4ee64452 (diff)
incorporate Tom Culliton's patches for readline
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)