mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 00:52:30 +02: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
1 changed files with 10 additions and 1 deletions
|
|
@ -38,6 +38,7 @@
|
||||||
#else
|
#else
|
||||||
# include <curses.h>
|
# include <curses.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <termios.h>
|
||||||
|
|
||||||
#ifndef COLOR_PAIRS
|
#ifndef COLOR_PAIRS
|
||||||
# define COLOR_PAIRS 64
|
# define COLOR_PAIRS 64
|
||||||
|
|
@ -145,6 +146,7 @@ static int init_curses(void)
|
||||||
#if !defined (WIN32) && defined(SIGWINCH)
|
#if !defined (WIN32) && defined(SIGWINCH)
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
#endif
|
#endif
|
||||||
|
struct termios term;
|
||||||
|
|
||||||
if (!initscr())
|
if (!initscr())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
@ -158,12 +160,19 @@ static int init_curses(void)
|
||||||
act.sa_handler = sig_winch;
|
act.sa_handler = sig_winch;
|
||||||
sigaction(SIGWINCH, &act, NULL);
|
sigaction(SIGWINCH, &act, NULL);
|
||||||
#endif
|
#endif
|
||||||
raw(); noecho(); idlok(stdscr, 1);
|
cbreak(); noecho(); idlok(stdscr, 1);
|
||||||
#ifdef HAVE_CURSES_IDCOK
|
#ifdef HAVE_CURSES_IDCOK
|
||||||
/*idcok(stdscr, 1); - disabled currently, causes redrawing problems with NetBSD */
|
/*idcok(stdscr, 1); - disabled currently, causes redrawing problems with NetBSD */
|
||||||
#endif
|
#endif
|
||||||
intrflush(stdscr, FALSE); nodelay(stdscr, TRUE);
|
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())
|
if (has_colors())
|
||||||
start_color();
|
start_color();
|
||||||
else if (use_colors)
|
else if (use_colors)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue