From 9f0ef4953d153aaed45166050797e97545b96954 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Wed, 23 Mar 2011 23:20:24 +0000 Subject: Don't steal Ctrl-C from the kernel by default (so leave SIGINT enabled); add a flag to take it if required --- termkey.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'termkey.c') diff --git a/termkey.c b/termkey.c index 6b8b8ee..bfd577f 100644 --- a/termkey.c +++ b/termkey.c @@ -278,7 +278,12 @@ static TermKey *termkey_new_full(int fd, int flags, size_t buffsize, int waittim tk->restore_termios_valid = 1; termios.c_iflag &= ~(IXON|INLCR|ICRNL); - termios.c_lflag &= ~(ICANON|ECHO|ISIG); + termios.c_lflag &= ~(ICANON|ECHO); + + termios.c_cc[VQUIT] = 0; + termios.c_cc[VSUSP] = 0; + if(flags & TERMKEY_FLAG_CTRLC) + termios.c_cc[VINTR] = 0; tcsetattr(fd, TCSANOW, &termios); } -- cgit v1.2.3