summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-10-24 21:19:54 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-10-24 21:19:54 +0000
commitb43f210a474593bb2aff4bb989c7f40316101f4c (patch)
treeec201767b868478700e33b7defb0618ec3fe0be0
parent5f1cc94f84f96e6ac12f676adcce47d9746f0312 (diff)
downloadirssi-b43f210a474593bb2aff4bb989c7f40316101f4c.zip
Reset QUIT and INTR keys at quit.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1909 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/fe-text/screen.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/fe-text/screen.c b/src/fe-text/screen.c
index f784ce2e..3437ecf1 100644
--- a/src/fe-text/screen.c
+++ b/src/fe-text/screen.c
@@ -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);
}