diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2011-03-23 23:20:24 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2011-03-23 23:20:24 +0000 |
commit | 9f0ef4953d153aaed45166050797e97545b96954 (patch) | |
tree | 87e48ace622fe2ce3f476d2703548814a99d6753 /termkey.c | |
parent | a71f68dd5718a77d5a97fc6d8e2fcd816657bb3b (diff) | |
download | termo-9f0ef4953d153aaed45166050797e97545b96954.tar.gz termo-9f0ef4953d153aaed45166050797e97545b96954.tar.xz termo-9f0ef4953d153aaed45166050797e97545b96954.zip |
Don't steal Ctrl-C from the kernel by default (so leave SIGINT enabled); add a flag to take it if required
Diffstat (limited to 'termkey.c')
-rw-r--r-- | termkey.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); } |