diff options
-rw-r--r-- | fzy.c | 4 | ||||
-rw-r--r-- | tty.c | 3 |
2 files changed, 6 insertions, 1 deletions
@@ -153,6 +153,10 @@ void run(tty_t *tty, choices_t *choices){ strncpy(search, choices_get(choices, choices->selection), SEARCH_SIZE_MAX); search_size = strlen(search); choices_search(choices, search); + }else if(ch == 3 || ch == 4){ /* ^C || ^D */ + clear(tty); + tty_close(tty); + exit(EXIT_FAILURE); }else if(ch == 10){ /* Enter */ clear(tty); @@ -33,8 +33,9 @@ void tty_init(tty_t *tty, const char *tty_filename){ * Disable both of * ICANON Canonical input (erase and kill processing). * ECHO Enable echo. + * ISIG Disable signals from control characters */ - new_termios.c_lflag &= ~(ICANON | ECHO); + new_termios.c_lflag &= ~(ICANON | ECHO | ISIG); if(tcsetattr(tty->fdin, TCSANOW, &new_termios)) perror("tcsetattr"); |