summaryrefslogtreecommitdiffstats
path: root/src/c_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/c_input.c')
-rw-r--r--src/c_input.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/c_input.c b/src/c_input.c
index 7a23b90..8f15449 100644
--- a/src/c_input.c
+++ b/src/c_input.c
@@ -23,6 +23,21 @@
#include "m_prompt.h"
#include "m_loop.h"
+
+void c_signal_int(int signo)
+{
+ signal(SIGINT, c_signal_int);
+ (void)signo;
+ ioctl(1, TIOCSTI, "\002");
+}
+
+void signal_ign(int signo)
+{
+ signal(SIGINT, c_signal_int);
+ (void)signo;
+ signal(SIGTSTP, SIG_IGN);
+}
+
short
c_init_line(char psx, t_caps *tcaps)
{
@@ -34,7 +49,8 @@ short
if (!tgetent(NULL, term))
return (-1);
c_set_term_raw(1);
- signal(SIGINT, SIG_IGN);
+ signal(SIGINT, c_signal_int);
+ signal(SIGQUIT, signal_ign);
tcaps->cpos = 0;
tcaps->lpos = 0;
tcaps->nlines = 1;