mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
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
This commit is contained in:
parent
3f578b4b53
commit
3f3ea3c1b5
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user