Ticket #4144 (new defect) — at Initial Version

Opened 4 years ago

Last modified 4 months ago

mouse clicks don't work on ncurses-6.2, generate garbage to stdout

Reported by: slyfox Owned by:
Priority: major Milestone: Future Releases
Component: mc-tty Version: 4.8.25
Keywords: Cc: egmont
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

It's forward of downstream https://bugs.gentoo.org/753578 report.

When mc is built with ncurses-6.2 mouse keypresses in xterm don't work and generate garbage output. The following workaround seems to be enough to fix it locally:

  • lib/tty/key.c

    a b tty_get_event (struct Gpm_Event *event, gboolean redo_event, gboolean block) 
    21242124        gboolean extended = c == MCKEY_EXTENDED_MOUSE; 
    21252125 
    21262126#ifdef KEY_MOUSE 
    2127         extended = extended || (c == KEY_MOUSE && xmouse_seq == NULL 
    2128                                 && xmouse_extended_seq != NULL); 
     2127        extended = extended || (c == KEY_MOUSE && xmouse_extended_seq != NULL); 
    21292128#endif /* KEY_MOUSE */ 
    21302129 
    21312130        xmouse_get_event (event, extended); 
$ LANG=C ./src/mc --version
GNU Midnight Commander 4.8.25-59-ga2bccac62
Built with GLib 2.64.5
Built with ncursesw 6.2
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With support for X11 events
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:
 cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish
Data types:
 char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

Some details:

$ tput kmous | cat -v
^[[M
$ echo $TERM
xterm-256color

Actual generated sequences by xterm are in form of "\e[<0;10;28M", but mc expects-non-extended form of "\e[bxy".

Note: See TracTickets for help on using tickets.