mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05:00
Reset QUIT and INTR keys at quit.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1909 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
5f1cc94f84
commit
b43f210a47
@ -64,6 +64,7 @@ int screen_width, screen_height;
|
||||
static int scrx, scry;
|
||||
static int use_colors;
|
||||
static int freeze_refresh;
|
||||
static cc_t old_intr, old_quit;
|
||||
|
||||
static int init_screen_int(void);
|
||||
static void deinit_screen_int(void);
|
||||
@ -166,8 +167,11 @@ static int init_curses(void)
|
||||
#endif
|
||||
intrflush(stdscr, FALSE); nodelay(stdscr, TRUE);
|
||||
|
||||
/* disable ^C (INTR) and ^\ (QUIT) keys */
|
||||
/* disable ^C (INTR) and ^\ (QUIT) keys */
|
||||
if (tcgetattr(0, &term) == 0) {
|
||||
old_intr = term.c_cc[VINTR];
|
||||
old_quit = term.c_cc[VQUIT];
|
||||
|
||||
term.c_cc[VINTR] = '\0';
|
||||
term.c_cc[VQUIT] = '\0';
|
||||
tcsetattr(0, 0, &term);
|
||||
@ -220,6 +224,15 @@ static int init_screen_int(void)
|
||||
|
||||
static void deinit_screen_int(void)
|
||||
{
|
||||
struct termios term;
|
||||
|
||||
/* enable INTR and QUIT keys again */
|
||||
if (tcgetattr(0, &term) == 0) {
|
||||
term.c_cc[VINTR] = old_intr;
|
||||
term.c_cc[VQUIT] = old_quit;
|
||||
tcsetattr(0, 0, &term);
|
||||
}
|
||||
|
||||
endwin();
|
||||
g_free_and_null(screen_root);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user