mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Ticket #1926: Ctrl-\ key behaviour in NCurses-based MC.
Generally, Ctrl-\ is a default assignment to SIGQUIT signal. S-Lang breaks this assignment. NCurses doesn't, therefore MC just quits when user presses the Ctrl-\ key. This commit emulates the S-Lang way in NCurses-based MC. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
e23b0d5a95
commit
56bf77ae57
@ -8,6 +8,17 @@
|
|||||||
|
|
||||||
#include "lib/global.h" /* include <glib.h> */
|
#include "lib/global.h" /* include <glib.h> */
|
||||||
|
|
||||||
|
/* Taken from S-Lang's slutty.c */
|
||||||
|
#ifdef ultrix /* Ultrix gets _POSIX_VDISABLE wrong! */
|
||||||
|
# define NULL_VALUE -1
|
||||||
|
#else
|
||||||
|
# ifdef _POSIX_VDISABLE
|
||||||
|
# define NULL_VALUE _POSIX_VDISABLE
|
||||||
|
# else
|
||||||
|
# define NULL_VALUE 255
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* If true lines are shown by spaces */
|
/* If true lines are shown by spaces */
|
||||||
extern gboolean slow_tty;
|
extern gboolean slow_tty;
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
/*** global variables **************************************************/
|
/*** global variables **************************************************/
|
||||||
|
|
||||||
/*** file scope macro definitions **************************************/
|
/*** file scope macro definitions **************************************/
|
||||||
|
|
||||||
#if defined(_AIX) && !defined(CTRL)
|
#if defined(_AIX) && !defined(CTRL)
|
||||||
# define CTRL(x) ((x) & 0x1f)
|
# define CTRL(x) ((x) & 0x1f)
|
||||||
#endif
|
#endif
|
||||||
@ -158,6 +159,8 @@ tty_init (gboolean slow, gboolean ugly_lines)
|
|||||||
|
|
||||||
/* use Ctrl-g to generate SIGINT */
|
/* use Ctrl-g to generate SIGINT */
|
||||||
cur_term->Nttyb.c_cc[VINTR] = CTRL ('g'); /* ^g */
|
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);
|
tcsetattr (cur_term->Filedes, TCSANOW, &cur_term->Nttyb);
|
||||||
|
|
||||||
tty_start_interrupt_key ();
|
tty_start_interrupt_key ();
|
||||||
|
@ -52,21 +52,11 @@
|
|||||||
|
|
||||||
|
|
||||||
/*** global variables **************************************************/
|
/*** global variables **************************************************/
|
||||||
|
|
||||||
extern int reset_hp_softkeys;
|
extern int reset_hp_softkeys;
|
||||||
|
|
||||||
/*** file scope macro definitions **************************************/
|
/*** file scope macro definitions **************************************/
|
||||||
|
|
||||||
/* Taken from S-Lang's slutty.c */
|
|
||||||
#ifdef ultrix /* Ultrix gets _POSIX_VDISABLE wrong! */
|
|
||||||
# define NULL_VALUE -1
|
|
||||||
#else
|
|
||||||
# ifdef _POSIX_VDISABLE
|
|
||||||
# define NULL_VALUE _POSIX_VDISABLE
|
|
||||||
# else
|
|
||||||
# define NULL_VALUE 255
|
|
||||||
# endif
|
|
||||||
#endif /* ultrix */
|
|
||||||
|
|
||||||
#ifndef SA_RESTART
|
#ifndef SA_RESTART
|
||||||
# define SA_RESTART 0
|
# define SA_RESTART 0
|
||||||
#endif
|
#endif
|
||||||
@ -79,7 +69,6 @@ extern int reset_hp_softkeys;
|
|||||||
#define SLTT_MAX_SCREEN_ROWS 512
|
#define SLTT_MAX_SCREEN_ROWS 512
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*** file scope type declarations **************************************/
|
/*** file scope type declarations **************************************/
|
||||||
|
|
||||||
/*** file scope variables **********************************************/
|
/*** file scope variables **********************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user