summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-10-23 20:55:22 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-10-23 20:55:22 +0000
commit3f3ea3c1b551f3fee4c67613880f5362eba862e8 (patch)
treebade7cffd06cbd9c3c7c800ebc15af78cf0a6e84
parent3f578b4b536f5cbe54a08b2895f5bd26a7e40975 (diff)
downloadirssi-3f3ea3c1b551f3fee4c67613880f5362eba862e8.zip
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
-rw-r--r--src/fe-text/screen.c11
1 files changed, 10 insertions, 1 deletions
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 <curses.h>
#endif
+#include <termios.h>
#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)