1
1

Ticket #1876: use Ctrl-g key to generate SIGINT signal.

Ctrl-g instead of Ctrl-c is used now to generate SIGINT signal.
SIGINT signal generating for MC/NCurses library is enabled now.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
Andrew Borodin 2009-12-23 16:18:25 +00:00
родитель 8cfffc5bfa
Коммит a20ebb3818
2 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -149,14 +149,17 @@ tty_init (gboolean slow, gboolean ugly_lines)
ESCDELAY = 200; ESCDELAY = 200;
#endif /* HAVE_ESCDELAY */ #endif /* HAVE_ESCDELAY */
/* use Ctrl-g to generate SIGINT */
cur_term->Nttyb.c_cc[VINTR] = CTRL ('g'); /* ^g */
tcsetattr (cur_term->Filedes, TCSANOW, &cur_term->Nttyb);
tty_start_interrupt_key (); tty_start_interrupt_key ();
do_enter_ca_mode (); do_enter_ca_mode ();
raw (); tty_raw_mode ();
noecho (); noecho ();
keypad (stdscr, TRUE); keypad (stdscr, TRUE);
nodelay (stdscr, FALSE); nodelay (stdscr, FALSE);
} }
void void
@ -180,12 +183,14 @@ tty_reset_shell_mode (void)
void void
tty_raw_mode (void) tty_raw_mode (void)
{ {
raw (); raw (); /* FIXME: uneeded? */
cbreak ();
} }
void void
tty_noraw_mode (void) tty_noraw_mode (void)
{ {
nocbreak (); /* FIXME: unneeded? */
noraw (); noraw ();
} }

Просмотреть файл

@ -264,8 +264,7 @@ tty_init (gboolean slow, gboolean ugly_lines)
tcgetattr (fileno (stdin), &boot_mode); tcgetattr (fileno (stdin), &boot_mode);
/* 255 = ignore abort char; XCTRL('g') for abort char = ^g */ /* 255 = ignore abort char; XCTRL('g') for abort char = ^g */
/* SLang_init_tty (XCTRL ('c'), 1, 0); */ SLang_init_tty (XCTRL ('g'), 1, 0);
SLang_init_tty (255, 1, 0);
if (ugly_lines) if (ugly_lines)
SLtt_Has_Alt_Charset = 0; SLtt_Has_Alt_Charset = 0;