From 3f3ea3c1b551f3fee4c67613880f5362eba862e8 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 23 Oct 2001 20:55:22 +0000 Subject: [PATCH] Using cbreak() mode again, but disable QUIT and INTR keys. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1902 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/screen.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/fe-text/screen.c b/src/fe-text/screen.c index dff77c64..f784ce2e 100644 --- a/src/fe-text/screen.c +++ b/src/fe-text/screen.c @@ -38,6 +38,7 @@ #else # include #endif +#include #ifndef COLOR_PAIRS # define COLOR_PAIRS 64 @@ -145,6 +146,7 @@ static int init_curses(void) #if !defined (WIN32) && defined(SIGWINCH) struct sigaction act; #endif + struct termios term; if (!initscr()) return FALSE; @@ -158,12 +160,19 @@ static int init_curses(void) act.sa_handler = sig_winch; sigaction(SIGWINCH, &act, NULL); #endif - raw(); noecho(); idlok(stdscr, 1); + cbreak(); noecho(); idlok(stdscr, 1); #ifdef HAVE_CURSES_IDCOK /*idcok(stdscr, 1); - disabled currently, causes redrawing problems with NetBSD */ #endif intrflush(stdscr, FALSE); nodelay(stdscr, TRUE); + /* disable ^C (INTR) and ^\ (QUIT) keys */ + if (tcgetattr(0, &term) == 0) { + term.c_cc[VINTR] = '\0'; + term.c_cc[VQUIT] = '\0'; + tcsetattr(0, 0, &term); + } + if (has_colors()) start_color(); else if (use_colors)