Ticket #54662: patch_ncurses6x.diff

File patch_ncurses6x.diff, 1.3 KB (added by philippetev (Philip Petev), 7 years ago)

Patch for ncurses 6.x+

  • lib/tty/tty-ncurses.c

    old new  
    179179void
    180180tty_init (gboolean mouse_enable, gboolean is_xterm)
    181181{
     182    struct termios mode;
     183
    182184    initscr ();
    183185
    184186#ifdef HAVE_ESCDELAY
     
    194196    ESCDELAY = 200;
    195197#endif /* HAVE_ESCDELAY */
    196198
    197 #ifdef NCURSES_VERSION
     199    tcgetattr (STDIN_FILENO, &mode);
    198200    /* use Ctrl-g to generate SIGINT */
    199     cur_term->Nttyb.c_cc[VINTR] = CTRL ('g');   /* ^g */
     201    mode.c_cc[VINTR] = CTRL ('g');      /* ^g */
    200202    /* disable SIGQUIT to allow use Ctrl-\ key */
    201     cur_term->Nttyb.c_cc[VQUIT] = NULL_VALUE;
    202     tcsetattr (cur_term->Filedes, TCSANOW, &cur_term->Nttyb);
    203 #else
    204     /* other curses implementation (bsd curses, ...) */
    205     {
    206         struct termios mode;
     203    mode.c_cc[VQUIT] = NULL_VALUE;
     204    tcsetattr (STDIN_FILENO, TCSANOW, &mode);
    207205
    208         tcgetattr (STDIN_FILENO, &mode);
    209         /* use Ctrl-g to generate SIGINT */
    210         mode.c_cc[VINTR] = CTRL ('g');  /* ^g */
    211         /* disable SIGQUIT to allow use Ctrl-\ key */
    212         mode.c_cc[VQUIT] = NULL_VALUE;
    213         tcsetattr (STDIN_FILENO, TCSANOW, &mode);
    214     }
    215 #endif /* NCURSES_VERSION */
     206    /* curses remembers the "in-program" modes after this call */
     207    def_prog_mode ();
    216208
    217209    tty_start_interrupt_key ();
    218210