mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
(tty_init): support curses other than ncurses.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
787e24966d
commit
4247120b4a
@ -194,11 +194,25 @@ tty_init (gboolean mouse_enable, gboolean is_xterm)
|
||||
ESCDELAY = 200;
|
||||
#endif /* HAVE_ESCDELAY */
|
||||
|
||||
#ifdef NCURSES_VERSION
|
||||
/* use Ctrl-g to generate SIGINT */
|
||||
cur_term->Nttyb.c_cc[VINTR] = CTRL ('g'); /* ^g */
|
||||
/* disable SIGQUIT to allow use Ctrl-\ key */
|
||||
cur_term->Nttyb.c_cc[VQUIT] = NULL_VALUE;
|
||||
tcsetattr (cur_term->Filedes, TCSANOW, &cur_term->Nttyb);
|
||||
#else
|
||||
/* other curses implementation (bsd curses, ...) */
|
||||
{
|
||||
struct termios mode;
|
||||
|
||||
tcgetattr (STDIN_FILENO, &mode);
|
||||
/* use Ctrl-g to generate SIGINT */
|
||||
mode.c_cc[VINTR] = CTRL ('g'); /* ^g */
|
||||
/* disable SIGQUIT to allow use Ctrl-\ key */
|
||||
mode.c_cc[VQUIT] = NULL_VALUE;
|
||||
tcsetattr (STDIN_FILENO, TCSANOW, &mode);
|
||||
}
|
||||
#endif /* NCURSES_VERSION */
|
||||
|
||||
tty_start_interrupt_key ();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user